- From: Cameron McCormack <cam@mcc.id.au>
- Date: Thu, 05 Jan 2012 15:35:58 +1100
- To: João Eiras <joaoe@opera.com>
- CC: "public-script-coord@w3.org" <public-script-coord@w3.org>
João Eiras: > Is it really an issue ? Are there overloaded APIs which support both > dictionaries and arrays/sequences ? I don't recall any at the moment. Or > if there was ambiguity, renaming one of the overloads would be an option. Currently there are not, but I thought Anne's request to allow this kind of overloading (for the DOM method proposal of having an append() take various kinds of values) was reasonable. I think the kind of API where you can pass a single item or an array of items is not uncommon. And allowing primitive types and DOMString as the item type but not dictionary types seems a bit limiting. In the future it will be possible to create an object that has [[Class]] == "Array" (maybe via the proposed <| operator), and jQuery results objects could be real arrays, be allowed as sequence values, and still have custom prototypes to hold all of the jQuery methods.
Received on Thursday, 5 January 2012 04:37:03 UTC