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

Re: [Bug 17508] Let enum lists end with a comma

From: Brendan Eich <brendan@mozilla.org>
Date: Fri, 07 Dec 2012 13:58:43 -0800
Message-ID: <50C26693.8090209@mozilla.org>
To: David Sheets <kosmo.zb@gmail.com>
CC: Anne van Kesteren <annevk@annevk.nl>, bugzilla@jessica.w3.org, public-script-coord@w3.org
David Sheets wrote:
> On Fri, Dec 7, 2012 at 2:43 AM, Anne van Kesteren<annevk@annevk.nl>  wrote:
>> On Fri, Dec 7, 2012 at 5:41 AM, David Sheets<kosmo.zb@gmail.com>  wrote:
>>> How does this opinion resolve the bug as invalid? Either web-apps or
>>> WebIDL is in error.
>> The bug was filed against WebIDL. WebIDL does not consider its
>> definition of enum to be a bug, so web-apps needs to be fixed.
>
> So WONTFIX, then?
>
>>> Is it really worth it to fail to parse WebIDL because of a (useful for
>>> autogenerated lists) trailing comma?
>> That seems like a slippery slope.
>
> What's at the bottom of the slope? Simple line-based elision?
>
>> And you could use join instead.
>
> This argument has convinced the C, ECMAScript, Python, Ruby, OCaml,
> and other language communities to mandate fatal errors on trailing
> delimiters. Developers in these languages and targeting these
> languages enjoy these pointless fatal errors.

There is no such error for JS (ECMAScript), for arrays literals:

js> a = [1,
2,
3,
];
[1, 2, 3]

I agree with you these are pointless. It isn't just the auto-generated 
list use-case that suffers. Manually maintained lists and version 
control of same using line-based diff also pay a small ongoing price.

I was sad back in the day when (ANSI?) C standardized against optional 
trailing comma in enum. I fought hard for optional trailing comma in 
array initialisers in JS.

/be
Received on Friday, 7 December 2012 21:59:15 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 8 May 2013 19:30:08 UTC