Allen's lambda syntax proposal

Peter Michaux petermichaux at
Sat Nov 29 23:33:48 PST 2008

2008/11/29 Brendan Eich <brendan at>:

> // Instead of lambda (a, b, c) { ... }, why not:
> { |a, b, c| ... } ?

In know this syntax primarily from Ruby's blocks.

This would allow writing

  var foo = {|a, b, c| ...};

which could be written even shorter as

  var foo(a, b, c) {...};

The later is more consistent with the following which would also be
necessary at times.

  lambda(a, b, c) {...}

I'd prefer the last two options.

> Anyway, we need a fun weekend thread, and everyone loves syntax. Comments?

The following please!

  (lambda (a b c) ...)



More information about the Es-discuss mailing list