Allen's lambda syntax proposal

Mark S. Miller erights at google.com
Mon Dec 1 08:54:25 PST 2008


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.

function () {
 var foo = 42;
 {|| var foo = 3; }();
 return foo;
}

and:

function () {
 var foo = 42;
 { var foo = 3; }
 return foo;
}

do give the same answer.

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


More information about the Es-discuss mailing list