4 ms·
To make [case] work as a pure function, you would have to roll your own thunks by passing anonymous functions in for each case to be evaluated and each outcome.
by sah 18y ago
To make [case] work as a pure function, you would have to roll your own thunks by passing anonymous functions in for each case to be evaluated and each outcome. That works, but all that boilerplate becomes tedious.
I like Ruby's block syntax for doing this without macros, but unfortunately you only get to pass in one block per function.
- raganwald 18y agoIt's a worse-is-better thing: it makes some forms of abstraction awkward, you have to fool around chaining methods. But it does take the most common case and make it simple. It seems like a legitimate design choice, even if I don't always like the resuls.