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

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 UTC