Re: APIs that overload numbers and strings

On Mon, Apr 15, 2013 at 11:07 AM, Boris Zbarsky <bzbarsky@mit.edu> wrote:

> On 4/14/13 9:09 PM, Ehsan Akhgari wrote:
>
>> Changing the type of the attribute here to string doesn't seem like a
>> great idea to me because it will hide the enumerated nature of the
>> string used here.
>>
>
> We'd still use an enum:
>
>   enum Something {
>     "0", "1", "2", "whatever"
>   };
>

Hmm, OK, that seems fine, albeit ugly.

--
Ehsan
<http://ehsanakhgari.org/>

Received on Monday, 15 April 2013 16:02:38 UTC