On Wed, Apr 2, 2008 at 11:15 PM, Lars Hansen <[EMAIL PROTECTED]> wrote: > > > > Is this already in AS3? If so, is it often used? > > The syntax comes from E4X, which is incorporated into AS3 and > Spidermonkey. Try this in Firefox: > > <script type="text/javascript;e4x=1"> > var x = <ns:p xmlns:ns="http://www.opera.com/"><ns:q>Hi > there</ns:q></ns:p> > var ns = new Namespace("http://www.opera.com/"); > var em = "q" > document.writeln(x.ns::[em]); > </script>
I'm aware of E4X. I meant: is it possible to refer to lexical bindings in this manner in AS3? I guess I don't see what use case is satisfied by this feature that isn't already met by the existence of Map. After all, the effect of this feature is to turn lexical environments into (quasi) first class maps, with the peculiar restriction that new name/value pairs cannot be added, though existing ones can be mutated. If a user actually needs that functionality, it wouldn't be difficult to subclass Map to get it. And, yes, I know it's already possible to do this with lexically scoped eval. But why do you want to add another way to do it? -Jon _______________________________________________ Es4-discuss mailing list [email protected] https://mail.mozilla.org/listinfo/es4-discuss
