W3C home > Mailing lists > Public > public-webapps@w3.org > October to December 2008

Re: Comments on some Web IDL extended attribute names

From: Cameron McCormack <cam@mcc.id.au>
Date: Sun, 5 Oct 2008 23:25:45 +1100
To: "public-webapps@w3.org Group WG" <public-webapps@w3.org>
Message-ID: <20081005122545.GC23209@arc.mcc.id.au>

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/
Received on Sunday, 5 October 2008 12:26:40 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 18:49:28 GMT