Maybe I missed this from the article, but it would be really cool if someone would mash this pattern matching up in a macro with defn (maybe called "?defn" or something) so you could do stuff like the following without relying on apply:
I have barely played around with Clojure though, so if there is a nicer way to express that code, please drop a comment and try not to tear me to pieces. My point is that I would love to have pattern matching available in function definitions similar to Haskell/Erlang.
6 comments
[ 2.5 ms ] story [ 19.2 ms ] thread