Sujet : Re: "A diagram of C23 basic types"
De : bc (at) *nospam* freeuk.com (bart)
Groupes : comp.lang.cDate : 03. Apr 2025, 21:48:40
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <vsms75$1i8ud$1@dont-email.me>
References : 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
User-Agent : Mozilla Thunderbird
On 03/04/2025 20:37, Kaz Kylheku wrote:
On 2025-04-03, BGB <cr88192@gmail.com> wrote:
In my compiler, I did both ' and _, ...
Personally though, I prefer using _ as a digit separator in these scenarios.
>
But, yeah, can't use comma without creating syntactic ambiguity.
False; you can't use comma because of an /existing/ ambiguity.
Commas are overwhelmingly used to separate list elements in programming languages.
They only become possible for numeric separators if you abandon any sort of normal syntax and use one based, for example, on Lisp.
Even then, someone looking at your language and seeing:
55,688
isn't going to to see the number 55688, they will see two numbers, 55 and 688, because that is what is what they expect from a typical programming language.
Even when they normally use "," for decimal point, they're not going to see 55.688 either, for the same reason.
In my view, comma is 100 times more valuable as a list separator, than in being able to write 1,000,000 (which I can do as 1'000'000 or 1_000_000 or even 1 million).
I only use commas for output to be viewed as something that is pure numeric data, and not source code (so viewed by people who may not be programmers). Even then, the separator can be anything:
1,000,000 decimal
1011'0001 binary
7FFF'FFFF hex
I wouldn't use commas for non-decimal; it looks weird.
Comma separation causes problems when arguments can be empty!
It seems to be the other way around: how many missing arguments are there here between a and b:
F(a b)
When written as F(a,,,b) then it becomes clearer. (This is if you allow omitted in-between arguments, which I no longer do.)
In C preprocessing MAC() is actually a macro with one argument,
which is empty.
I assume MAC() is a macro invocation? Then MAC could equally be a macro with zero arguments, and none is provided.