Block lambda is cool, its syntax isn't

Thaddee Tyl thaddee.tyl at
Wed Jan 18 01:59:34 PST 2012

On Wed, Jan 18, 2012 at 10:28 AM, Gavin Barraclough
<barraclough at>wrote:

> Just a thought, has a prefix ^ been considered?
> A lambda that takes no arguments could be:
> ^{ /*...*/ }
> And a lambda with some arguments:
> ^(x,y){ /*...*/ }
> I just find this really readable, the syntax for lambdas that take no
> arguments is delightfully minimal (just one extra character!), my brain is
> well trained to expect argument lists to be delimited by parentheses so I
> find this much easier to understand, and I find the ^ character pleasingly
> evocative of λ. :-)

This is really a matter of taste.

    { (a, b) ... }

    ^(a, b) { ... }

    { |a, b| ... }

Of course, some characters are easier to type than others, especially in
non-qwerty keyboards (I'm thinking about the pipe "|").

But what matters most is readability, since code is more often read than
written. So far, people seem to think that pipes are more readable.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the es-discuss mailing list