W3C home > Mailing lists > Public > public-script-coord@w3.org > April to June 2013

Re: APIs that overload numbers and strings

From: Ehsan Akhgari <ehsan.akhgari@gmail.com>
Date: Mon, 15 Apr 2013 13:14:20 -0400
Message-ID: <CANTur_4LL8J8k-gJndWiWvwbmByanzCfvgamJweze9u6-XT0OQ@mail.gmail.com>
To: Anne van Kesteren <annevk@annevk.nl>
Cc: Boris Zbarsky <bzbarsky@mit.edu>, Allen Wirfs-Brock <allen@wirfs-brock.com>, "public-script-coord@w3.org" <public-script-coord@w3.org>
On Mon, Apr 15, 2013 at 12:11 PM, Anne van Kesteren <annevk@annevk.nl>wrote:

> On Mon, Apr 15, 2013 at 5:01 PM, Ehsan Akhgari <ehsan.akhgari@gmail.com>
> wrote:
> > Hmm, OK, that seems fine, albeit ugly.
>
> You could always do enum LegacySomething { "1" , ... }; and enum
> Something and then have (LegacySomething or Something) as "type". But
> yes, if you want to preserve the old API it's going to be ugly either
> way.
>

That's a good idea, a bit better than mixing the values in a single enum...

--
Ehsan
<http://ehsanakhgari.org/>
Received on Monday, 15 April 2013 17:15:28 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:37:49 UTC