Re: ES4 note: Reserved namespaces

2008-04-29 Thread Waldemar Horwat
Lars Hansen wrote:
 -Original Message-
 From: Waldemar Horwat [mailto:[EMAIL PROTECTED] 
 Sent: 28. april 2008 18:39
 To: Lars Hansen
 Cc: es4-discuss
 Subject: Re: ES4 note: Reserved namespaces

 I agree with everything except:

 * reserved namespaces may not be aliased (ie they are illegal
   on the right hand side of = in namespace ns1 = ns2)

 If we want to make reserved namespaces into keywords, 
 
 We do not...
 
 that 
 might be ok.  However, at the current time they're not 
 keywords, and one could write:

   const foo = intrinsic;
 
 But foo can't be used as a namespace qualifier in any
 context, so that's OK.
 
 and:

   namespace instrinsic = my_namespace;
 
 That one either shadows an existing namespace or causes an 
 ambiguity, so I don't think that's a problem either.
 
 Being able to write those but not:

   namespace foo = intrinsic;

 is just splitting hairs without achieving anything important. 
 
 I disagree.  The rules guarantee that it is possible for the
 implementation to determine statically whether a particular
 fixture definition introduces a binding in one of the reserved
 namespaces.  (That actually depends on namespace annotations
 always being statically resolvable.   Some of the details
 of how that's handled are still open but that's the goal.)

That's missing the point.  As far as I've seen in this discussion so far, 
prohibiting

  namespace foo = intrinsic;

does not achieve anything important and it does introduce a weird asymmetry 
(and yet another strange rule for programmers to memorize) into the language.  
It does *not* achieve the guarantee that it's statically possible to determine 
whether a particular fixture definition introduces a binding in one of the 
reserved namespaces.  That guarantee is satisfied by resolving namespaces at 
compile time, with or without this prohibition.

Waldemar
___
Es4-discuss mailing list
Es4-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es4-discuss


Re: ES4 note: Reserved namespaces

2008-04-28 Thread Waldemar Horwat
I agree with everything except:

* reserved namespaces may not be aliased (ie they are illegal
  on the right hand side of = in namespace ns1 = ns2)

If we want to make reserved namespaces into keywords, that might be ok.  
However, at the current time they're not keywords, and one could write:

  const foo = intrinsic;

and:

  namespace instrinsic = my_namespace;

Being able to write those but not:

  namespace foo = intrinsic;

is just splitting hairs without achieving anything important.  You still 
shouldn't be able to define properties in the reserved namespaces except as 
outlined in the proposal.


One can also write:

  var intrinsic = 3;

which (I hope) would shadow the intrinsic namespace within its hoisted scope.

Waldemar
___
Es4-discuss mailing list
Es4-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es4-discuss


RE: ES4 note: Reserved namespaces

2008-04-28 Thread Lars Hansen
 -Original Message-
 From: Waldemar Horwat [mailto:[EMAIL PROTECTED] 
 Sent: 28. april 2008 18:39
 To: Lars Hansen
 Cc: es4-discuss
 Subject: Re: ES4 note: Reserved namespaces
 
 I agree with everything except:
 
 * reserved namespaces may not be aliased (ie they are illegal
   on the right hand side of = in namespace ns1 = ns2)
 
 If we want to make reserved namespaces into keywords, 

We do not...

 that 
 might be ok.  However, at the current time they're not 
 keywords, and one could write:
 
   const foo = intrinsic;

But foo can't be used as a namespace qualifier in any
context, so that's OK.

 and:
 
   namespace instrinsic = my_namespace;

That one either shadows an existing namespace or causes an 
ambiguity, so I don't think that's a problem either.

 Being able to write those but not:
 
   namespace foo = intrinsic;
 
 is just splitting hairs without achieving anything important. 

I disagree.  The rules guarantee that it is possible for the
implementation to determine statically whether a particular
fixture definition introduces a binding in one of the reserved
namespaces.  (That actually depends on namespace annotations
always being statically resolvable.   Some of the details
of how that's handled are still open but that's the goal.)

 You still shouldn't be able to define properties in the 
 reserved namespaces except as outlined in the proposal.
 
 
 One can also write:
 
   var intrinsic = 3;
 
 which (I hope) would shadow the intrinsic namespace within 
 its hoisted scope.

It should, and it's considered desirable that this would work,
which is why the reserved namespaces are not reserved words.

--lars
___
Es4-discuss mailing list
Es4-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es4-discuss