4 ms·
Frankly, I'd prefer: %1 + %2 * 2 Over: _ + _ * 2 With the former syntax, it's much more obvious what the function is doing.
by weavejester 16y ago
Frankly, I'd prefer:
%1 + %2 * 2
Over:
_ + _ * 2
With the former syntax, it's much more obvious what the function is doing.
- KirinDave 16y agoWhy?
- cemerick 16y agoBecause _ and _ refer to two different values using the same name. Adding a third _ would refer to yet another value, etc.
- KirinDave 16y agoNot to be excessively glib, but I can't resist pointing out that children successfully comprehend this notation daily, it's called "fill in the blank."
- cemerick 16y agoIt's not a matter of it not being comprehensible once you know what's going on; it's a matter of consistency with the rest of the language. Everywhere else, each symbol refers to one and only one value within a given lexical context. Breaking from that expectation would require some compelling benefits.
- weavejester 16y agoWell, does it mean: (x, y) -> x + y Or: (x) -> x + x If I didn't know the language, I'd assume the latter, so it fails the principle of least surprise (at least for me).