Re:Is Clojure dying, and what has Ruby got to do with it?
by lilactown on Thursday May 25, 2017 @06:37PM
(#14420698)
If we're golfing...
[ Parent
| on HN ]
Re:Is Clojure dying, and what has Ruby got to do with it?
by smnplk on Thursday May 25, 2017 @09:13PM
(#14421421)
And a bit shorter version...
24
;)
Re:Is Clojure dying, and what has Ruby got to do with it?
by mrkgnao on Thursday May 25, 2017 @11:42PM
(#14421839)
I wonder, does #(* %1) do anything sensible?
Re:Is Clojure dying, and what has Ruby got to do with it?
by latte on Friday May 26, 2017 @07:31AM
(#14423310)
Clojure's * can accept any number of arguments, including zero (returns 1 in this case), one (acts as identity function on numbers) or more than two (returns the product of all arguments). This helps to simplify arithmetic expressions in some cases (e. g. polynominals) and allows to calculate a sum or product of any sequence, including empty one, using (reduce * xs)