3 ms·
But then, Clojure can also do this for an arbitrary number of operands (< 1 2 3 4 5 6) ;; true Any function can also take arguments from a list,
by dyadic 13y ago
But then, Clojure can also do this for an arbitrary number of operands
(< 1 2 3 4 5 6)
;; true
Any function can also take arguments from a list,
(apply < (range 1000))
;; true
Prefix notation really comes into it's own when you start looking at multiple arity functions. Please don't confuse unfamiliarity with absurdity.
- jroseattle 13y agoThose are great examples, and I agree -- the compactness far exceeds something like Scala. Although I think I could create a function in Scala that permits the same thing, yes? Mostly the arbitrary operands or range reference imply recursion & iteration, which I believe I could implement easily. (Check me if I'm wrong here, I might be missing something.) I wouldn't have suggested that, except that Clojure (as I understand it) also encourages that one can "expand" the language. I would see adding this capability as a Scala function in the same light.