Re: [WebIDL] Simplify callbacks

I had missed this email, and misinterpret your previous email which had
several definitions for (c).
I prefer (c), but the first one
"accept functions and objects with a descriptive function name "
So when you said "But for me based on the above I prefer (c). "
I thought I agree with you. But I guess that is not the case. :(


-Olli


On 12/28/2011 08:16 AM, Cameron McCormack wrote:
> Cameron McCormack:
>> People will weight the pros and cons differently, I imagine. But for me
>> based on the above I prefer (c).
>
> Based on that, I have changed the spec in this direction so that we move
> towards accepting Function objects rather than Function objects or plain
> objects with properties of particular names.
>
> I've incorporated a variation of the "callback" proposal (just the
> single function version) from
> http://www.w3.org/mid/4EE7F7F7.9080600@mcc.id.au without the function
> identifier, and this is what specification authors are now recommended
> to use in place of:
>
> [Callback,NoInterfaceObject]
> interface Blah {
> ...
> };
>
> For new APIs (and older ones that don't support the property style), you
> would write for example:
>
> callback CheeseHasArrivedNotification = void (DOMString cheeseType);
>
> interface CheeseManager {
> void requestAsyncCheese(CheeseHasArrivedNotification n);
> };
>
> and requestAsyncCheese would take only a Function object.
>
> [Callback] is now gone altogether, and for the cases where we do need to
> support a callback object with a property, or any other cases that would
> currently be handled by [Callback], you define a callback interface. For
> EventListener, since we need it to continue to support objects with a
> handleEvent property, we would write:
>
> callback interface EventListener {
> void handleEvent(Event evt);
> };
>
> with no need for [NoInterfaceObject] since callback interface don't
> cause interface objects to exist normally.
>
> http://dev.w3.org/cvsweb/2006/webapi/WebIDL/Overview.xml.diff?r1=1.432;r2=1.433;f=h
>
>
> Anne (being the original commentor), I'll assume you are OK with this
> change unless I hear otherwise.
>
> Thanks,
>
> Cameron
>
>

Received on Thursday, 16 February 2012 23:22:09 UTC