可变参数函数的起源是什么?
可变参数函数是否源自特定语言、数学、科学文章......?有什么想法吗?
Did Variadic functions originate from a specific language, from math, from an scientific article...? Any idea?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
尽管标签可变参数函数听起来很现代,但概念它可能和车轮一样古老。好吧,也许没有那么多,但它的演变是如此合乎逻辑,以至于它可能在此过程中被多次重新发现。
Watcom 编译器可能是第一个 实现 C 语言:
也就是说,我认为这个问题更适合 math.stackexchange.com。
Even though the label variadic functions sounds modern, the concept of what it is may be as old as the wheel. Ok, maybe not that much, but its such a logical evolution that it was probably re-discovered multiple times along the way.
The Watcom compiler may have been the first to have implemented it for the C language:
That said, I think this question is better suited to math.stackexchange.com.
他们想要 printf() 和 scanf()。
They wanted printf() and scanf().
BCPL、Algol 68 以及 Fortran 和 COBOL(从某个角度来看)具有可变参数函数:
http://en .wikipedia.org/wiki/Printf_format_string
可变参数作为“可变数量的参数”是一个数学概念,无论如何,它要古老得多。
BCPL, Algol 68 and Fortran and COBOL (from a certain point of view) have variadic functions:
http://en.wikipedia.org/wiki/Printf_format_string
Variadic as "variable number of arguments" is a mathematical concept, much older, anyway.