Allen's lambda syntax proposal

Alex Russell alex at dojotoolkit.org
Sun Dec 7 19:33:53 PST 2008


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Indeed, it can look like an expression to begin a name assignment:

	var thinger = {("foo"+"bar"): ... };

Has a syntax like this been shot down yet?:

	var thinger = {{ foo, bar }: ... };

Since objects (much less literals) aren't used as keys in hashes  
often, this strikes me as being somewhat less ambiguous. The short (no  
args) version might then be:

	var thinger = {: ... };

Arguments against?

Regards

On Dec 5, 2008, at 9:23 PM, David-Sarah Hopwood wrote:

> P T Withington wrote:
>> Would it work to move the parameter list inside the block (as in the
>> Smalltalk way, but as a regular parameter list, not using ||'s)?
>>
>>  {(a, b) a + b}
>>
>> AFAICT, `{(` is a syntax error for an expression in es3.
>
> I think this is unambiguous, but I don't like it because it has no
> symbol or combination of symbols that is specific to a lambda.
> ( "{(" can occur as the start of a block.)
>
> -- 
> David-Sarah Hopwood
> _______________________________________________
> Es-discuss mailing list
> Es-discuss at mozilla.org
> https://mail.mozilla.org/listinfo/es-discuss

- --
Alex Russell
slightlyoff at google.com
alex at dojotoolkit.org BE03 E88D EABB 2116 CC49 8259 CF78 E242 59C3 9723

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (Darwin)

iD8DBQFJPJWhz3jiQlnDlyMRApB7AKC4b0P/dw07uo1vpgPkl/wBbC6z4ACg4tnK
SC5TGDclT3euwl/h9YWpJa4=
=6c8Y
-----END PGP SIGNATURE-----


More information about the Es-discuss mailing list