W3C home > Mailing lists > Public > public-webapps@w3.org > April to June 2009

Re: [WebIDL] On overloaded operations in an effective overload set

From: Shiki Okasaka <shiki@google.com>
Date: Wed, 17 Jun 2009 17:49:08 +0900
Message-ID: <2fdcc83a0906170149x5c0202abg1fde882e97c5fb76@mail.gmail.com>
To: Shiki Okasaka <shiki@google.com>, public-webapps@w3.org
Hi Cameron,

The [AllowAny] extended attribute looks nice, and it will provide a
clearer ECMAScript runtime semantics. One thing still not very clear
to me is that a DOMString with [AllowAny] and a primitive type should
be distinguishable as in the example or not; maybe should we treat a
parameter with [AllowAny] like an 'any' type in an effective overload
set for simplicity?

Thank you,

 - Shiki

ps. it's good to see the 'double' type in Web IDL.

On Wed, Jun 17, 2009 at 3:34 PM, Cameron McCormack<cam@mcc.id.au> wrote:
> Hi Shiki.
>
> Shiki Okasaka:
>> I've chatted with several engineers and researchers about this. If
>> this interface A becomes an effective overload set in Web IDL, we need
>> a clear set of rules to resolve ECMAScript function calls like below
>> into either f2 or f3:
>>
>>    a.f(123, "hello", "there", "3.14");
>>    a.f("not a number", "hello", "2.72", 3.14);
>>    a.f("123", 1234, "3.14", "2.72");
>>
>> And it seems defining those rules would be not very easy.
>
> I’ve made DOMString and the numeric & boolean types be distinguishable,
> now.  Your examples from the original mail in this thread,
>
>  * <f2, (DOMString, DOMString)> and <f3, (long, DOMString)>
>  * <f2, (DOMString, DOMString, float)> and <f3, (long, DOMString, DOMString)>
>  * <f2, (DOMString, DOMString, float, float)> and
>   <f3, (long, DOMString, DOMString, float)>
>
> should now work.  I have revised the definition of the effective
> overload set and the overload resolution algorithm.  Review would be
> welcome.
>
>  http://dev.w3.org/2006/webapi/WebIDL/#dfn-effective-overload-set
>  http://dev.w3.org/2006/webapi/WebIDL/#dfn-overload-resolution-algorithm
>
> Thanks,
>
> Cameron
>
> --
> Cameron McCormack ≝ http://mcc.id.au/
>
Received on Wednesday, 17 June 2009 08:49:49 GMT

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