Block lambda is cool, its syntax isn't

Axel Rauschmayer axel at
Thu Jan 12 22:23:57 PST 2012

> I'm not in love with Ruby syntax but {(a, b) a + b} isn't as distinctive and clearly a lambda-like thing. You're right about that, but turning back to function-based syntax with a different introductory keyword goes the wrong direction. This is why I keep coming back to "different syntax is a virtue". The correspondence-principle-based semantics are different enough.

Two more pro-pipe points: block lambdas (lambda blocks?) will often be arguments of functions:
    foo( {|x,y| x + y } )
    foo( {(x,y) x + y } )

With parens, you are starting to look a bit like Lisp... ;-)

I also find that pipes stick out better as something alien. Parens feel too much like someone has forgotten to add a semicolon, inside a normal block:   (Rick Waldron’s Gist comparing parens and pipes)

But man does that code profit from block lambdas – really nice to look at. In some cases, things would fit into a single line where you were forced to split into multiple lines without BLs.

Dr. Axel Rauschmayer
axel at


More information about the es-discuss mailing list