What was the origin of the variadic functions?

Variadic functions come from a specific language, from mathematics, from a scientific article ...? Any idea?

+4
source share
3 answers

There are many mathematical and logical operations that naturally occur as variative functions. For example, summing numbers or concatenating strings or other sequences are operations that can be logically applied to any number of operands.

Despite the fact that the label variation functions sound modern, the concept of what it is may be as old as the wheel. Well, maybe not so much, but its such a logical evolution that it was probably re-discovered several times along the way.

The Watcom compiler may have been the first to be implemented for the C language:

Variadic functions revert to the Watcom stack-based calling convention.

The Watcom C / C ++ Compiler is a compiler for the C and C ++ programming languages, which creates executable programs for several platforms and operating systems. The code that it produces for MS-DOS runs very fast. It was one of the first compilers to support Intel 80386 protected mode. In the mid-1990s, some of the most technically ambitious DOS games, such as Doom , Descent, and Duke Nukem 3D , were built using Watcom C. Although it is no longer for sale commercially Sybase, the Watcom C / C ++ compiler and the Watcom Fortran compiler were available as a free and open source Watcom package using SciTech software

However, I think this question is better for math.stackexchange.com .

+3
source

They wanted printf () and scanf ().

0
source

BCPL, Algol 68 and Fortran and COBOL (from a certain point of view) have variational functions:

http://en.wikipedia.org/wiki/Printf_format_string

Variadic as a "variable number of arguments" is a mathematical concept, much older, anyway.

0
source

Source: https://habr.com/ru/post/1380388/


All Articles