3 ms·
Depends on your language. In Lisp, + takes any number of arguments. In C++, it takes exactly two. (I'm presuming that by 'add', you mean '+'. If not, then '
by AnimalMuppet 7y ago
Depends on your language. In Lisp, + takes any number of arguments. In C++, it takes exactly two.
(I'm presuming that by 'add', you mean '+'. If not, then 'add' takes however many arguments it is defined as a function to take, and that still is language- or library-dependent.)
(And if you refer to pure math, then add or + is only a function of more than two arguments if it associates, which is dependent on the argument type.)
- keymone 7y agono, by `add` i mean exactly the function `add`, not + operator. he cherry picked the example to show how operators are "better", he's wrong. in practice sum of a sequence is more important concept than it's special case - sum of two arguments.
- AnimalMuppet 7y agoWhat function 'add'? 'add' in some computer language? If so, which language? Or 'add' in mathematics? If so, what is the difference between 'add' and '+'?
- keymone 7y ago`add` is just another manipulation on guido's part. `sum` is the name of the concept.
- AnimalMuppet 7y agoOne more time: Are you talking about a specific feature in a language, or are you talking about mathematics?
- keymone 7y agoa concept in programming
- AnimalMuppet 7y agoThen what is your basis for saying that the sum of a sequence is more important than the sum of two numbers? Given associativity, the sum of a sequence is the same as recursively taking the sum of two numbers. Going the other direction, if you have the sum of a sequence, then the sum of two numbers is obviously included in that. The two approaches therefore seem completely equivalent to me. So why say that one is the more important concept?
- keymone 7y agoBecause it’s more general