> Problem: How do you invoke methods on table?
> 
> table.tellAxel = function() {alert('here is a method call');};
> table['tellAxel'] = function() {alert('here is a function entry");};
> table.tellAxel();  // here is a method call
> table['tellAxel'].apply(null,[]);  // here is a function entry
>  
> Using AWB’s terminology, accessing properties is part of the program 
> definition domain, accessing collection elements is part of the application 
> data domain. And it’s better not to mix the two.
> 
> Yes, that is exactly the point.


So you are arguing in favor of approach #1, right? Then I would make “your” Map 
a subtype of Object. typeof is currently best limited to primitives (and to 
distinguishing them from objects), so introducing a new result would suggest 
adding a new primitive. But I don’t think that is necessary: Once the semantics 
of [] have been changed in accordance with approach #1 then you can just write 
a library that provides Maps and other collections.

-- 
Dr. Axel Rauschmayer

a...@rauschma.de
twitter.com/rauschma

home: rauschma.de
blog: 2ality.com



_______________________________________________
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to