W3C home > Mailing lists > Public > public-script-coord@w3.org > October to December 2015

RE: Overload of Dictionary and Callback - why is this disallowed?

From: Domenic Denicola <d@domenic.me>
Date: Tue, 1 Dec 2015 16:05:21 +0000
To: Boris Zbarsky <bzbarsky@mit.edu>, Harald Alvestrand <harald@alvestrand.no>, "public-script-coord@w3.org" <public-script-coord@w3.org>
Message-ID: <CY1PR0501MB1369C3E4F22E54AB73EB5A8CDF0F0@CY1PR0501MB1369.namprd05.prod.outlook.com>
From: Boris Zbarsky [mailto:bzbarsky@mit.edu]

> That said, I think we could, in fact, make callback functions and dictionaries
> distinguishable.  It wouldn't even require any changes to the overload
> resolution algorithm, as far as I can tell:

I think we could, but it would be confusing to allow APIs to be designed that way, and should be discouraged.

> That said, what is the actual use case here?  If this is a new API, you should
> probably just use a dictionary and not create the two overloads.

... and if it's an old API, you should use prose.
Received on Tuesday, 1 December 2015 16:05:51 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 1 December 2015 16:05:52 UTC