Allen's lambda syntax proposal

Mark S. Miller erights at google.com
Mon Dec 1 08:30:43 PST 2008


On Mon, Dec 1, 2008 at 7:31 AM, P T Withington <ptw at pobox.com> wrote:

> On 2008-11-30, at 01:30EST, Brendan Eich wrote:
>
>  // Instead of lambda (a, b, c) { ... }, why not:
>> { |a, b, c| ... } ?
>>
>
> I would rather have a more literate syntax, lest we degenerate to where
> practically any comic book blasphemy is a valid program.
>
> (BTW, I'm pretty sure I have that same Byte issue, in a similar box, with a
> similar musty smell, _and_ "the blue book".  Back then, worrying that 'line
> noise' or the death throes of your modem hanging up would write code for you
> was a legitimate concern.  Today, it is just my old eyes that might gloss
> over `{||` and wonder why the `var`s in that block are not visible in the
> enclosing function...)
>

Since it's a lambda, the 'var's will be visible in the enclosing function.

The point of having a very compact syntax for lambda is too make it pleasant
to write control abstractions, as one does casually in Smalltalk. With the
verbose "lambda" spelling, people will avoid those, or invent macro systems
(as Scheme programmers do) mostly so they can avoid seeing all those extra
"lambda" letters in the code.

Think of lambdas as blocks plus a bit more, rather than function minus a
bit. Viewed this way, their block-like syntax is a virtue.

-- 
   Cheers,
   --MarkM
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20081201/0c3f4a42/attachment.html>


More information about the Es-discuss mailing list