Allen's lambda syntax proposal

P T Withington ptw at pobox.com
Mon Dec 1 09:21:09 PST 2008


On 2008-12-01, at 11:54EST, Mark S. Miller wrote:

> On Mon, Dec 1, 2008 at 8:47 AM, P T Withington <ptw at pobox.com> wrote:
>
>>
>> Eh?  So:
>>
>> function () {
>> var foo = 42;
>> {|| var foo = 3; }
>> return foo;
>> }
>>
>> and:
>>
>> function () {
>> var foo = 42;
>> { var foo = 3; }
>> return foo;
>> }
>>
>> Give the same answer?
>
>
> No, because you forgot to call it.

Cool. So I can use `{||` and `}` to comment out blocks of code...  :P

> function () {
> var foo = 42;
> {|| var foo = 3; }();
> return foo;
> }
>
> and:
>
> function () {
> var foo = 42;
> { var foo = 3; }
> return foo;
> }
>
> do give the same answer.

Ok, your suggestion of 'block plus' not 'function minus' is making  
more sense to me.  Still hard for me to understand the newspeak.   
Trying to wrap my mind around `var` meaning "free"; I think I get it.   
But, I still think `{||` looks like my cat stepped on the keyboard.


More information about the Es-discuss mailing list