[Bug 12248] Make objects first-class API citizens

http://www.w3.org/Bugs/Public/show_bug.cgi?id=12248

--- Comment #36 from Cameron McCormack <cam@mcc.id.au> 2011-03-16 22:54:32 UTC ---
I think it's worth looking at both of the two options Allen and Jonas mention: 

* either allow IDL operations to be declared to take named arguments, so that
in the ECMAScript language binding that would correspond to taking an
additional object argument holding the named arguments (and so that other
language bindings could utilise their native mechanisms for named arguments);
or

* add a dictionary type to Web IDL, which you would use directly as an argument
type (similarly to how [Callback] interfaces are being used for this purpose in
some specs), and which would let you define the types of individual values in
it.

We might want both.  I like the first approach since it can map more easily to
native mechanisms in other languages, but:

* what if a specification author wants to have an operation that takes more
than one set of named arguments (for whatever reason; I don't know that we have
any need for this currently, though)?

* what if a specification author wants to have the named arguments object not
as the final argument (which is what I'm assuming we'd require)?

-- 
Configure bugmail: http://www.w3.org/Bugs/Public/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.

Received on Wednesday, 16 March 2011 22:54:34 UTC