Hi Maciej and Anne.
Maciej Stachowiak:
I think [NativeObject] should be renamed to [Callback]. It is meant to
be used for callback objects that have a single designated callback
method, right?
Not only a single callback method, perhaps multiple. But yes, it’s
pretty much for callbacks. [Callback] looks nicer than [NativeObject],
so I think that’s a reasonable change.
I think [Variadic] should be renamed [Optional]. A function may be
variadic, but a parameter is optional, and this goes on the parameter.
Anne van Kesteren:
To me [Optional] does not really convey zero or more arguments very
well.
Maciej Stachowiak:
I see, I misunderstood what [Variadic] does. I think [Optional] would be
a useful addition for functions that have a fixed number of optional
arguments. Unless Web IDL has some way to represent that which I missed.
Yeah, [Variadic] is for Java-like varargs (where the type is given for
the extra arguments).
You can do optional arguments at the moment by overloading with a
different number of arguments, like is done in XMLHttpRequest for
open(). Would you want to specify the value to use for [Optional]
arguments if it is omitted (like C++), or just to map it to overloaded
functions?
[Optional] could be defined such that:
interface A {
void f(in long w, [Optional] in long x, in long y, [Optional] int long z);
};
is equivalent to:
interface A {
void f(in long w);
void f(in long w, in long x, in long y);
void f(in long w, in long x, in long y, in long z);
};
I’m on vacation from tomorrow for two weeks, but I’ll carve out some
time for working on Web IDL when I return.
Thanks,
Cameron
--
Cameron McCormack ≝ http://mcc.id.au/