Propose simpler string constant

Thomas thomasjamesfoster at bigpond.com
Wed Dec 16 12:27:36 UTC 2015


Out of curiosity, is anyone working on a proposal for enum? Given the keyword has been reserved for so long, it seems a little strange for a proposal not to be floating around - unless I've missed something.

> On 16 Dec 2015, at 10:31 PM, Coroutines <coroutines at gmail.com> wrote:
> 
>> On Wed, Dec 16, 2015 at 3:20 AM, Thomas <thomasjamesfoster at bigpond.com> wrote:
>> IMHO it'd be a huge mistake to not use symbols for enums.
>> 
>> In my head this:
>> 
>> const colours = enum {
>>  Red,
>>  Yellow,
>>  Green,
>>  Blue
>> }
>> 
>> should 'desugar' to something like this in ES6:
>> 
>> const colours = {
>>  Red: Symbol('Red'),
>>  Yellow: Symbol('Yellow'),
>>  Green: Symbol('Green'),
>>  Blue: Symbol('Blue')
>> }
>> 
>> Thomas
> 
> This person gets it. +1  :-)
> _______________________________________________
> es-discuss mailing list
> es-discuss at mozilla.org
> https://mail.mozilla.org/listinfo/es-discuss


More information about the es-discuss mailing list