Sujet : Re: question about linker
De : already5chosen (at) *nospam* yahoo.com (Michael S)
Groupes : comp.lang.cDate : 29. Nov 2024, 13:28:10
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <20241129142810.00007920@yahoo.com>
References : 1 2 3 4 5 6 7 8 9 10 11 12
User-Agent : Claws Mail 4.1.1 (GTK 3.24.34; x86_64-w64-mingw32)
On Fri, 29 Nov 2024 11:04:16 +0000
Bart <
bc@freeuk.com> wrote:
My original point was trying to address why 'const' as used in C
might be confusing. I was trying to compare how non-mutable variables
are designated in other languages. There it's a keyword that is part
of the declaration syntax, not the type syntax.
I don't see your point.
How 'mut' in Rust is different from 'const' in C except for having
opposit polarity?
How 'readonly' in C# is different from 'const' in C?
I suggested that C is confusing because 'const' looks as though it's
like the former, but it's part of the latter. Which also means you
can have multiple 'const' in a declaration (putting asided repeated
'consts').
>
IMHO, any way to mix more than one 'modifier' (not in C standard
meaning of the word, but in more general meaning) is potentially
confusing. It does not matter whether modifier is 'const' or '*' or []
or ().
However not having this ability forces programmer to use too many
typedefs. Multiple typedef are not too bad by themselves, the problem
with them is that programmer has to invent many type names and then
reader has to remember them. So in practice such enforcement ends up
less readable rather than more readable.
So objectively, it IS more complicated than elsewhere with more scope
for getting it wrong.
>