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: Iteration in ES4

2008-04-28 Thread Waldemar Horwat
Brendan Eich wrote:
 On Apr 25, 2008, at 2:08 PM, Brendan Eich wrote:
 
 for (prop in obj) {
  ... obj[prop] ...
 }

 to look like

 for each (value in obj) {
  ... value ...
 }

 where obj might be an Array. The symmetry between for-each-in and for-
 in that E4X half-supports (viz, prototype property enumeration with
 shadowing, and deleted-after-loop-starts coherence) is broken.
 
 Just in case this is not well-known, SpiderMonkey starting in Firefox  
 1.5 supported E4X and made the for-each-in loop work for all object  
 types, not just XML/XMLList. But not on Array element (indexed  
 property) values only, in index order -- again property creation  
 order, and named as well as indexed enumerable properties, are  
 visited. This shares code with for-in and preserves the equivalence  
 shown in the rewrite example above.

I'm baffled trying to figure out what you're trying to say in the last 
paragraph.

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


Next meeting

2008-04-28 Thread Waldemar Horwat
Are we having a meeting in Vancouver?  What day and time and what's the agenda?

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


Re: Iteration in ES4

2008-04-28 Thread Brendan Eich
On Apr 28, 2008, at 6:04 PM, Waldemar Horwat wrote:

 Brendan Eich wrote:
 On Apr 25, 2008, at 2:08 PM, Brendan Eich wrote:

 for (prop in obj) {
  ... obj[prop] ...
 }

 to look like

 for each (value in obj) {
  ... value ...
 }

 where obj might be an Array. The symmetry between for-each-in and  
 for-
 in that E4X half-supports (viz, prototype property enumeration with
 shadowing, and deleted-after-loop-starts coherence) is broken.

 Just in case this is not well-known, SpiderMonkey starting in Firefox
 1.5 supported E4X and made the for-each-in loop work for all object
 types, not just XML/XMLList. But not on Array element (indexed
 property) values only, in index order -- again property creation
 order, and named as well as indexed enumerable properties, are
 visited. This shares code with for-in and preserves the equivalence
 shown in the rewrite example above.

 I'm baffled trying to figure out what you're trying to say in the  
 last paragraph.

Let me try again:

I added for-each-in support for all types when implementing E4X in  
SpiderMonkey, not just for XMLList and XML types. But I did not make  
for-each-in do anything different given an array object on the right  
of 'in' from what the for-in would do if you used the loop variable  
to index into the array to get the value produced in the loop  
variable by for-each-in.

Does that help?

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


RE: Next meeting

2008-04-28 Thread Lars Hansen
To my knowledge we are not having a meeting in Vancouver.  The next
scheduled meeting for ES4 work is the TC meeting in San Francisco
at the end of May. 

--lars

 -Original Message-
 From: [EMAIL PROTECTED] 
 [mailto:[EMAIL PROTECTED] On Behalf Of Waldemar Horwat
 Sent: 28. april 2008 19:12
 To: es4-discuss
 Subject: Next meeting
 
 Are we having a meeting in Vancouver?  What day and time and 
 what's the agenda?
 
 Waldemar
 ___
 Es4-discuss mailing list
 Es4-discuss@mozilla.org
 https://mail.mozilla.org/listinfo/es4-discuss
 
___
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