Block lambda is cool, its syntax isn't

Allen Wirfs-Brock allen at wirfs-brock.com
Thu Jan 12 14:52:00 PST 2012


On Jan 12, 2012, at 2:23 PM, François REMY wrote:

> Am I wrong if I say there not a bigger issue with block lambda than with the current object notation on the matter?

I think you're correct.  An ExpressionStatment can not begin with a { so,without changing that rule,  there should be no potential for ambiguity between Block and BlockLambda.  The only issue is distinguishing ObjectLiteral and BlockLambda  and from that perspective a {(  is as good as a {| as neither is ambiguous with existing ObjectLiteral syntax,

At that point, it becomes a matter of taste.  Which of  {|x| x.foo()} or {(x) x.foo()} looks better to you?  I find the | | more pleasant and easer for my eyes to pick out, but I'm undoubtably influenced by many years of reading and writing Smalltalk code.

Allen



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20120112/5ebbde35/attachment-0001.html>


More information about the es-discuss mailing list