> It isn't clear what you guys are arguing about. > > Under my proposal, > old objects and old code operating upon old objects continue to work as it > always has. > new objects continue to work like old objects unless the new objects have > been explicitly defined to have "collection access behavior" > > You can consider objects with "collection access behavior" to be a new "type" > (I would prefer to say "kind") of object. > > If my proposal, you designate this new kind of object by defining a one of > the collection accessor properties (could be either well know private names > or something like "operator []"). > > The primitive way to test if an object is a "collection" would be to do a > property existence test on a collection accessor property.
I would leave the proposal as it is (no typeof change etc.), only adapt it in either of two ways: 1. Deprecate [] for property access in non-collection objects and use methods such as Object.getProperty(name) and Object.setProperty(name, value), instead. 2. Introduce new syntax for collection access, e.g. collection.[key] or collection@[key] Either of the two adaptations would result in a clear separation of concerns between the application data domain and the program definition domain. -- Dr. Axel Rauschmayer [email protected] twitter.com/rauschma home: rauschma.de blog: 2ality.com _______________________________________________ es-discuss mailing list [email protected] https://mail.mozilla.org/listinfo/es-discuss

