Re: APIs that overload numbers and strings

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