5 ms·
And vaguely reminiscent of Smalltalk, which I'd guess is where Ruby got it from.
by cess11 3y ago
And vaguely reminiscent of Smalltalk, which I'd guess is where Ruby got it from.
- xiaq 3y agoElvish's lambda syntax used to be [arg]{ ... }. But since [arg] is also the syntax for lists, it can get confusing - so I decided to move the argument list inside { ... }. And going through all the metacharacters Elvish already had, | was the one that was meaningless at the start of the lambda body, so I settled on {|arg| ... }. I only realized the similarity with Smalltalk after that. I did learn a little Smalltalk many years ago but completely forgot about it, but it's possible that the knowledge was always somewhere in my subconscious brain.