Subj : Re: E4X To : Jiri Znamenacek From : Brendan Eich Date : Thu Jul 22 2004 12:11 pm Jiri Znamenacek wrote: > I don't know about any better place so I'm going to ask here. And > despite the comments I like this extension to ECMAScript very much. > > Why "XPath" on objects is written in this way > e.employee.(name == "Joe") > e.g. object->object->special_kind_of_object? Because that's a syntactic extension, which is allowed by ECMA-262 Edition 3 Chapter 16. > From the JS point of view (erm, MY point of view) I would expect rather > e.employee[name == "Joe"] > which at first sigh returns object(s) of "type" employee. That's not a syntactic extension, it is an incompatible revision to existing syntax and semantics: a[name == "Joe"] today should evaluate the index expression and convert its boolean result to a string, referencing a property identified by either 'true' or 'false', depending on whether name == "Joe". /be .