Sujet : Re: how cast works?
De : Keith.S.Thompson+u (at) *nospam* gmail.com (Keith Thompson)
Groupes : comp.lang.cDate : 10. Aug 2024, 01:12:31
Autres entêtes
Organisation : None to speak of
Message-ID : <87bk215j80.fsf@nosuchdomain.example.com>
References : 1 2 3 4 5 6 7 8 9 10 11 12
User-Agent : Gnus/5.13 (Gnus v5.13)
Bart <
bc@freeuk.com> writes:
On 09/08/2024 22:47, Keith Thompson wrote:
Bart <bc@freeuk.com> writes:
[...]
I might also ask you not to pretend you don't know what is meant by
'implicit cast'. Or worse, pretending that other people might be
confused.
Of course I understand exactly what you mean by "implicit cast". You
mean "implicit conversion". A phrase can be both clear and incorrect.
If you used the phrase "male cow" I would assume you mean "bull" and/or
"steer".
I'm sure most of those won't have gone anywhere near the standard, so
they won't be aware that in the 700 pages of N1570.PDF, 'explicit
cast' occurs all of once, while 'implicit cast' occurs one time less
often, which appears to be the sole reason for have a go at anyone who
commits the sin of using that expression.
Nobody has accused you of any "sin". Don't exaggerate.
I have pointed out that you are misusing a word that has a clear
definition, and that using the correct term "implicit conversion" would
be at least as clear and would cost you nothing. (Compare the extra 6
letters to the volume of text you've emitted arguing about it.)
[...]
Here it uses the term 'explicit cast'. Why is that; isn't the term
'cast' unambiguous without needing to say 'explicit'?
It's redundant.
>
OK. Does that mean we're allowed to use redundant terms too?
Nobody said you aren't.
[...]
You've snipped my quote from H.2.4p5 where it says:
>
... conversions (casts) ...
That wording does not appear in more recent drafts.
[...]
Explain why using the word "cast" incorrectly is better than using it
correctly. Explain why you can't just refer to explicit and implicit
conversions. Do you have a motivation other than being annoying?
>
'Cast' is shorter, and more directly is associated with conversions to
do with types.
In my compiler for example, '*conv*' is used in many different
contexts (eg. case conversion). '*cast*' is only used in two
functions, both to do with C type conversions.
>
But I also use both terms just to mix it up.
>
I remember people here getting castigated for using the term 'type
cast'. And yet, in H.2.4p1:
>
"The LIA−1 type conversions are the following type casts:"
That wording is no longer there in more recent editions. Annex H
refers to LIA-1 (Language Independent Arithmetic), ISO/IEC 10967–1;
perhaps that standard use the term "type casts".
>
My point is that even the professionals who write such documents get
it 'wrong', according to you.
Yes, and unlike you, they willingly correct their errors.
-- Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.comvoid Void(void) { Void(); } /* The recursive call of the void */