On Tue, Aug 19, 2008 at 1:00 AM, Ingvar von Schoultz
<[EMAIL PROTECTED]> wrote:
> From the descriptions it looks like this could instead use
> a syntax based on destructuring assignment, if es-harmony
> will have destructuring:
I expect es-harmony to have destructuring bind.
> var {toggle: t, set: s} = import
> ( fetchModule ('http://foo.com/someModule.js'),
> {document: doc, background: bg}
> );
> t();
>
> One advantage would be that people would remember this syntax
> easily, since it's useful elsewhere.
>
> As a side effect, one could then choose to use the returned
> object instead:
>
> var m = import
> ( fetchModule ('http://foo.com/someModule.js'),
> {document: doc, background: bg}
> );
> m.toggle();
Good suggestions! I like it.
--
Cheers,
--MarkM
_______________________________________________
Es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss