On Wed, Oct 19, 2011 at 9:12 AM, Axel Rauschmayer <[email protected]> wrote:
> Thus, there really are two alternatives: >> 1. Changing [] in the above manner plus object@nameObject for accessing >> properties (as you suggested). >> 2. [] stays as it is and @[] (perhaps there is something slicker, e.g. >> .[]) is introduced for collections and dicts. >> >> > Instead of creating a lot of complicated rules for 'object', how about > creating a new type 'collection'? > > > The result would be simple, but getting to #1 would indeed be a little > awkward, because existing code would still work, but would not use best > practices. > Awkwardness of this kind is a best practice ;-) > > What are you suggesting? A new primitive? Or a subtype of Object? I don’t > think there is a third alternative to those two. > I am suggesting that typeof return "collection" when the RHS defines a new semantic for [] (collection properties) and . (object properties). jjb
_______________________________________________ es-discuss mailing list [email protected] https://mail.mozilla.org/listinfo/es-discuss

