ES4 draft: Name

Lars Hansen lhansen at adobe.com
Fri Mar 21 07:40:09 PDT 2008


> -----Original Message-----
> From: P T Withington [mailto:ptwithy at gmail.com] On Behalf Of 
> P T Withington
> Sent: 21. mars 2008 04:58
> To: Lars Hansen
> Cc: Mark S. Miller; es4-discuss at mozilla.org
> Subject: Re: ES4 draft: Name
> 
> On 2008-03-20, at 23:07 EDT, Lars Hansen wrote:
> > Names depend on object identity insofar as some namespace values are

> > equal only to themselves.  I don't know how serialization is a
problem 
> > that figures into this, though clearly some namespaces values can't
be 
> > printed and then reconstituted in the language.
> 
> Maybe the question is: "Why do we need un-interned Names"?

Interning feels like it's beside the point but I think we're talking
about the same thing: should the programmer be able to alway recreate
any namespace value from its string representation?

Answering that in the negative, we've taken the approach that
unforgeable namespaces is one of two mechanisms the language has for
making properties and bindings inaccessible (the other being lexical
scope).

I think we've had the discussion before: are namespaces only for
organization or do they also provide some sort of integrity/hiding?
We've gone with the latter; it introduces complexity in some corners
(enumerability, reflection) but feels more useful in practice.

Forgeable (interned) namespaces are still available for serialization.

--lars



More information about the Es4-discuss mailing list