4 ms·
Why is it any better/faster than a simple switch case like this in Clojure: #(case % 1 31 2 28 3 31 4 30 5 31 6 30 7 31 8 31 9 30 10 31 11 30 12 31)
by xclojure 12y ago
Why is it any better/faster than a simple switch case like this in Clojure: #(case % 1 31 2 28 3 31 4 30 5 31 6 30 7 31 8 31 9 30 10 31 11 30 12 31)
- bvrlt 12y agoOr in C: f(int m) { return [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31][m] } The OP didn't claim it was better than anything, it's just a nice exercise in style!
- arsenerei 12y ago#([31 28 31 30 31 30 31 31 30 31 30 31] (dec %)) > Why is it any better/faster than a simple switch case like this in Clojure It's not about better or faster. It's fun to think of things like this. :)