Deutsch   English   Français   Italiano  
<20240809170514.433@kylheku.com>

View for Bookmarking (what is this?)
Look up another Usenet article

Path: ...!news.mixmin.net!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: Kaz Kylheku <643-408-1753@kylheku.com>
Newsgroups: comp.lang.c
Subject: Re: how cast works?
Date: Sat, 10 Aug 2024 00:06:10 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 35
Message-ID: <20240809170514.433@kylheku.com>
References: <v8vlo9$2oc1v$1@dont-email.me> <slrnvb7kis.28a.dan@djph.net>
 <v929ah$3u7l7$1@dont-email.me> <87ttfu94yv.fsf@nosuchdomain.example.com>
 <v93a3t$6q7v$1@dont-email.me> <v93e2q$8put$1@dont-email.me>
 <87bk228uzg.fsf@nosuchdomain.example.com> <v94pji$m1ib$1@dont-email.me>
 <v95lb7$26koh$1@dont-email.me> <20240809142622.467@kylheku.com>
 <87jzgp5php.fsf@nosuchdomain.example.com> <20240809152755.123@kylheku.com>
 <87frrd5jw7.fsf@nosuchdomain.example.com>
Injection-Date: Sat, 10 Aug 2024 02:06:10 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="55856fbef320f8e8129676162efccf12";
	logging-data="271156"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX1+duTajccEts/sWGN8BlKca7XKi+lrNbVI="
User-Agent: slrn/pre1.0.4-9 (Linux)
Cancel-Lock: sha1:bvSMvvJj3cxgeeVL9ZiCxLc6GvQ=
Bytes: 2757

On 2024-08-09, Keith Thompson <Keith.S.Thompson+u@gmail.com> wrote:
> Kaz Kylheku <643-408-1753@kylheku.com> writes:
>> On 2024-08-09, Keith Thompson <Keith.S.Thompson+u@gmail.com> wrote:
>>> Kaz Kylheku <643-408-1753@kylheku.com> writes:
>>> [...]
>>>> It almost makes sense to speak of "implicit cast" (i.e. coercion) in C,
>>>> because of what happens implicitly being so unsafe.
>>>
>>> I disagree, because that's not what "cast" means.
>>
>> "cast" means to (try to) project a value into another type.
>
> *Looks around* sorry, are we still in comp.lang.c?
>
> "Cast" has a number of meanings in contexts outside C, applicable to
> dice, eyes, fishing lines, ballots, magic spells, actors, liquid metal,
> and broken limbs, among other things.  In C, it means what the standard
> says it means, even if some people misuse it to refer to implicit
> conversions.
>
>> In C though, the nuance is something like "conversion that is mediated
>> by the presence of the cast notation", where "mediated" includes the
>> possibility that the cast notation has no effect at all
>> (e.g. 2 + (int) 3).
>
> I hadn't noticed before that the standard does have a formal definition
> of the term "cast", as well as "explicit conversion" and "implicit
> conversion".

Based on surveying all you quoted, I basically nailed it above.

-- 
TXR Programming Language: http://nongnu.org/txr
Cygnal: Cygwin Native Application Library: http://kylheku.com/cygnal
Mastodon: @Kazinator@mstdn.ca