Re:Clojure 1.2 Beta
by praptak on Wednesday July 14, 2010 @02:41PM
(#1515520)
C'mon, (condp = ...) was not that bad :)
[ Parent
| on HN ]
Re:Clojure 1.2 Beta
by jcromartie on Wednesday July 14, 2010 @03:19PM
(#1515639)
condp was rough for me. It requires too much shifting around of the pieces to figure out what it was doing.
I don't believe there is very much gain in code clarity here.
The core benefit of case over condp is efficiency. The condp is linear (goes over each clause until one matches) and case builds a very efficient dispatch function during compile time. This is why case only takes compile-time constant expressions.