4 ms·
+ - * / even doesn't support multi-data. (+ 1 2 3) would be 3,stupid
by cbsw 13y ago
+ - * / even doesn't support multi-data. (+ 1 2 3) would be 3,stupid
- crnixon 13y agoCool, awesome, great point. I tried Googling for your implementation and couldn't find it. Could you drop a link?
- wooby 13y agoYes, the arithmetic primitives don't support variadic arguments. You can see how + works - and that it only deals with the first two arguments - here: https://github.com/alandipert/gherkin/blob/278354246aebf14b86e05c726cb7a4db31658f56/gherkin#L914 https://github.com/alandipert/gherkin/blob/278354246aebf14b8.... A pull request fixing this would be welcome. In the meantime, for variadic addition, one can do: (load-file "core.gk") (reduce + 0 '(1 2 3)) ;=> 6