News for hackers. Stuff that matters.
Re:Regarding JavaScript trailing commas by mbrock on Saturday April 09, 2016 @02:03AM (#11460152)
Well, that opens up a whole new can of syntax worms...

But yeah, all of this stuff just makes me more convinced that Lisp syntax is the best ever.

Re:Regarding JavaScript trailing commas by naveen99 on Saturday April 09, 2016 @07:49AM (#11460883)
Lisp uses comas in macro evaluation, but not lists and dictionaries. Then you have reader macros. Lisp syntax can be arbitrarily complex.
Re:Regarding JavaScript trailing commas by mbrock on Saturday April 09, 2016 @09:15AM (#11461090)
It's not that the symbol comma is bad. Lisp uses it as a prefix to unquote a form, which is totally different from the use as a separator.
Re:Regarding JavaScript trailing commas by kazinator on Saturday April 09, 2016 @09:45AM (#11461188)
The commas do something in backquote syntax! They are operators, effectively.

In the Scheme backquote (dubbed quasiquote), the spec says that the read syntax ,X produces (unquote X). You can omit the comma, and then you just have X.

This is totally different from a comma which just punctuates syntax.

Re:Regarding JavaScript trailing commas by lispm on Saturday April 09, 2016 @01:13PM (#11462149)
macro and comma is fully unrelated. The comma in backquote expressions is not even limited to lists. Commas are used in backquote forms to force evaluation.

For example one can write a vector of three elements, where the second element is computed:

    `#(1 ,(first *features*) b)
Backquote list forms happen to be used in some macros as a kind of template forms. Macros can be defined without them and backquote forms are also used elsewhere in Lisp.
Re:Regarding JavaScript trailing commas by kazinator on Sunday April 10, 2016 @01:19AM (#11465023)
They are not "fully unrelated". The backquote syntax for constructing lists was primarily designed for macro programming. See the paper Evolution of Lisp by Guy Steele and Peter Gabriel:

"Macros took a major step forward with Lisp-Machine Lisp, which consolidated the various macro-defining techniques into two standardized features that were adopted throughout the MacLisp community and eventually into Common Lisp. The macro defining operator DEFMACRO provided list-structure destructuring to arbitrary depth; the backquote feature provided a convenient and concise pseudo-quoting facility. [ ... ] Backquote and DEFMACRO made a big difference. This leap in expressive power, made available in a standard form, began a new surge of language extension [...]" [3.3]

Re:Regarding JavaScript trailing commas by lispm on Sunday April 10, 2016 @06:31AM (#11465659)