Re: QSA, the problem with ":scope", and naming

* Alex Russell wrote:
>I strongly agree that it should be an Array *type*, but I think just
>returning a plain Array is the wrong resolution to our NodeList
>problem. WebIDL should specify that DOM List types *are* Array types.
>It's insane that we even have a NodeList type which isn't a real array
>at all.

It is quite normal to consider lists and arrays to be different things.
In Perl for instance you can use list operations like `grep` on arrays,
but you cannot use array operations like `push` on lists. For JavaScript
programmers it actually seems common to confuse the two, like with

  var node_list = document.getElementsByTagName('example');
  for (var ix = 0; ix < node_list.length; ++ix)
    node_list[ix].parentNode.removeChild(node_list[ix]);

which would remove all the children if node_list was an array like any
other. Pretending node lists are arrays in nomenclature would likely add
to that.
-- 
Björn Höhrmann · mailto:bjoern@hoehrmann.de · http://bjoern.hoehrmann.de
Am Badedeich 7 · Telefon: +49(0)160/4415681 · http://www.bjoernsworld.de
25899 Dagebüll · PGP Pub. KeyID: 0xA4357E78 · http://www.websitedev.de/ 

Received on Thursday, 20 October 2011 20:43:22 UTC