4 ms·
But, that is a bit different. Function calls return one value because expressions evaluate to one value. Functions accept multiple arguments the same way any ex
by asolove 13y ago
But, that is a bit different. Function calls return one value because expressions evaluate to one value. Functions accept multiple arguments the same way any expression can be made up of multiple values. What the formal parameters allow is a kind of destructuring assignment to give new names to values. (This is especially clear in eg. Clojure.)
- shiro 13y agoReturning from a function is calling the caller's continuation. If functions take multiple parameters, why not continuations? Semantically I think it's a lot cleaner to make every function 1-in 1-out. Multiple parameters are just a disguise of passing a tuple. In dynamically typed languages, though, it's difficult to make it efficient.