Sujet : Re: Top 10 most common hard skills listed on resumes...
De : bc (at) *nospam* freeuk.com (Bart)
Groupes : comp.lang.cDate : 08. Sep 2024, 11:27:33
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <vbju6l$1sqao$2@dont-email.me>
References : 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
User-Agent : Mozilla Thunderbird
On 08/09/2024 09:58, Michael S wrote:
On Sun, 8 Sep 2024 05:44:16 +0200
Janis Papanagnou <janis_papanagnou+ng@hotmail.com> wrote:
On 06.09.2024 13:34, Bart wrote:
>
In more complicated cases in languages, then some asymmetry does
come up. For example, suppose C allowed this (my language allows the
equivalent):
>
(c ? a : b) = x;
>
In Algol 68 you can write
>
IF c THEN a ELSE b FI := x
>
or, in a shorter form, as
>
( c | a | b ) := x
>
if you prefer.
>
Are you sure?
It seems to me that you got it backward.
The point here is that you can write such a 2-way select on the LHS of an assignment. C doesn't allow that unless you wrap it up as a pointer expression:
*(c ? &a : &b) = x;
In language like C, the LHS of an assignment is one of four categories:
A = Y; // name
*X = Y; // pointer
X[i] = Y; // index
X.m = Y; // member select
A is a simple variable; X represents a term of any complexity, and Y is any expression. (In C, the middle two are really the same thing.)
Some languages allow extra things on the LHS, but in C they can be emulated by transforming the term to a pointer operation. In the same it can emulate pass-by-reference (which objects which are not arrays!)