Date: Mon, 18 Aug 2025 06:45:35 +0200
> Several years ago, there were contributors on std-proposals
> wanting to use an "empty argument" to mean something else,
> such as "use the default argument for this position," i.e. something like this:
>
> The general consensus was that the syntax `f(a,b,)` if it's valid at all
> probably ought to mean the same thing as `f(a,b)` for consistency with other languages
> such as Python and JavaScript; but if there are still people wanting to repurpose the syntax to mean something else,
> then maybe it's better to just keep it invalid for now, pending further and deeper investigation.
There's already enough motivation to have them mean the same as in
other languages, and using ",," double commas to sneak in a default
argument in the middle would be insanely unexpressive. There is really
only one good way to use this syntax at this point: the same it's
being used in all the other places (including C++ list initialization,
enumerator lists, etc.).
There hypothetically being some people who want to use "a + b" to mean
subtraction doesn't mean we should hold off on adding "+" as an
addition operator.
> wanting to use an "empty argument" to mean something else,
> such as "use the default argument for this position," i.e. something like this:
>
> The general consensus was that the syntax `f(a,b,)` if it's valid at all
> probably ought to mean the same thing as `f(a,b)` for consistency with other languages
> such as Python and JavaScript; but if there are still people wanting to repurpose the syntax to mean something else,
> then maybe it's better to just keep it invalid for now, pending further and deeper investigation.
There's already enough motivation to have them mean the same as in
other languages, and using ",," double commas to sneak in a default
argument in the middle would be insanely unexpressive. There is really
only one good way to use this syntax at this point: the same it's
being used in all the other places (including C++ list initialization,
enumerator lists, etc.).
There hypothetically being some people who want to use "a + b" to mean
subtraction doesn't mean we should hold off on adding "+" as an
addition operator.
Received on 2025-08-18 04:45:49