On Thu, Aug 21, 2008 at 1:45 PM, Jon Zeppieri <[EMAIL PROTECTED]> wrote:
> On Thu, Aug 21, 2008 at 4:33 PM, Peter Michaux <[EMAIL PROTECTED]> wrote:
>>
>> which is handy in a language that constantly deals with side effects.
>> There is no Scheme "begin" or Lisp "progn" expression being proposed
>> which means we will have to write the following pattern
>>
>> var y;
>> let (x = 34) {
>> // side effects lines
>> document.getElementById('foo').className="n"+x;
>> // "return" y
>> y = x+4;
>> }
>>
>> where it would be nice to write something like
>>
>> var y = let (x = 34) begin {
>> document.getElementById('foo').className="n"+x;
>> x+4;
>> }
>
> There are comma expressions in ES, so using a let expression:
>
> var y = let (x = 34)
> document.getElementById('foo').className="n"+x,
> x+4;
>
> ... would do what you want, I believe.
That does seem to cover the use case I was describing.
Thanks.
Peter
_______________________________________________
Es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss