Re:Clojure vs. Scala
by cbp on Tuesday December 24, 2013 @10:34AM
(#6959714)
If I understand that scala code correctly it's just enumerating a multiple arity function manually. It's not that uncommon to see that in clojure for performance reaasons, clojure.core has plenty of examples as does the java-written compiler. It's a lot faster to enumerate the common arities than to use apply like:
And it usually just takes a couple of strokes in any decent text editor anyway.
[ Parent
| on HN ]
Re:Clojure vs. Scala
by jadyoyster on Tuesday December 24, 2013 @11:03AM
(#6959838)
You can however use macros to generate the fixed argument count versions; I don't know if Scala is able to do that.
Macros are available but still experimental. They're already used in stable branches in a number of projects though, including the Play Framework.