Allen's lambda syntax proposal

Michael Michael at lanex.com
Wed Dec 3 10:50:09 PST 2008


Since one of the issues brought up was the issue of readability, I figured
it was fitting to mention that in the context of E4X code the new syntax
could potentially be even more difficult to discern due to the double nested
braces depending on the details, whether it be the examples I gave or one
where it could be generated as such:

var doc =
<{{|a,b,c|...}(d,e,f)}><foo>{{|a,b,c|...}(d,e,f)}</foo></{{|a,b,c|...}(d,e,f
)}>

One would obviously hope never to see something like that, but if its legal
syntax I wouldn't put it past someone to try (in a larger document perhaps)
vice a named function call



-----Original Message-----
From: Peter Michaux [mailto:petermichaux at gmail.com] 
Sent: Wednesday, December 03, 2008 12:12 PM
To: Michael
Cc: es-discuss at mozilla.org
Subject: Re: Allen's lambda syntax proposal

2008/12/3 Michael <Michael at lanex.com>:
> If I understand the proposals correctly, then of the following e4x:

Why do you mention e4x? I'm not familiar with it but thought it only
adds XML literals to the language.

Peter


> var doc = {{|a,b,c|...}(d,e,f)}
>
> var doc = {^(a,b,c){...}(d,e,f)}
>
>
>
> var doc = {{||...}()}
>
> var doc = {^(){...}()}
>
>
>
> I honestly don't see the clarity of one over the other especially if
someone
> writes larger, asinine e4x.
>
> At least with the vertical bars it has similarities/inspiration from other
> languages as mentioned. This may be important for those migrating
>
> from one of those languages. When I first saw ^(){...}, the vision that
came
> to my head was the pointer operator in Visual C++




More information about the Es-discuss mailing list