Matthias van de Meent <boekewurm+postg...@gmail.com> writes:

> On Mon, 13 May 2024 at 10:42, Artur Formella <artur.formel...@gmail.com> 
> wrote:
>> Motivation:
>> Commas of this type are allowed in many programming languages, in some
>> it is even recommended to use them at the ends of lists or objects.
>
> Single trailing commas are a feature that's more and more common in
> languages, yes, but arbitrary excess commas is new to me. Could you
> provide some examples of popular languages which have that, as I can't
> think of any.

The only one I can think of is Perl, which I'm not sure counts as
popular any more.  JavaScript allows consecutive commas in array
literals, but they're not no-ops, they create empty array slots:

    ❯ js
    Welcome to Node.js v18.19.0.
    Type ".help" for more information.
    > [1,,2,,]
    [ 1, <1 empty item>, 2, <1 empty item> ]

- ilmari


Reply via email to