3 ms·
(Quick note: I had meant "unevaluated", but got iPhone-autocorrected with whatever it was I had typed to "in evaluated".) Right. However, #((+ % 2)) would be t
by saurik 14y ago
(Quick note: I had meant "unevaluated", but got iPhone-autocorrected with whatever it was I had typed to "in evaluated".)
Right. However, #((+ % 2)) would be the same idea for functions instead of expressions, and would then have allowed you to use that syntax to build and return a vector.
You can still build a vector, but you now have to realize that [] is a reader macro for (vector), so you can do #(vector 1 %) instead of #([1 %]).
However, if there was really great anonymous function syntax (maybe {} declaring a function with no arguments), then if wouldn't be a special form: it would be an internal function that took a boolean and two functions.
The result of that change would then trickle through all kinda of other macros (as they could then be implemented as functions instead), and soon you end up with a language that no longer relies on so much non-first-class syntax edits.