Sujet : Re: Top 10 most common hard skills listed on resumes...
De : janis_papanagnou+ng (at) *nospam* hotmail.com (Janis Papanagnou)
Groupes : comp.lang.cDate : 08. Sep 2024, 04:23:45
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <vbj5c3$1q2id$1@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/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0
On 06.09.2024 11:35, Bart wrote:
[...]
[...] in a language where you write 'A = A',
and one where you write 'A = .A'.
(I'd be interested in how, in the latter language, you'd write the
equivalent of 'A = A = A' in C, since the middle term is both on the
left of '=', and on the right!)
Since assignment is right associative it would probably be written in
a decomposed form as
A = .A
A = .A
It's easier to see if you use different objects; A = B = C would be
B = .C
A = .B
but that depends on how "the latter language"'s semantics are defined
(or whether there's, maybe, specific forms for assignment chains in
such a language). If you have a concrete language in mind inspect its
documentation, if you want to design such a language it's your task
to define its allowed syntax and associated semantics.
In "C" you have the right-hand assignment operation (B = C) create an
lvalue B but this is dereferenced to an rvalue (for A = B) if fed to
the left-hand assignment. (This is typical for languages that support
chained assignments.)
I'm reluctant to enter the discussion of your "symmetry" issue. Only
insofar to say that a program text that visibly _appears_ symmetric
in "C", like the 'A = A', isn't symmetric concerning its semantics.
That's certainly easier to see in languages with operators chosen
like ':=' or ':-' or '<-' etc., where the asymmetry is obvious, or
where the 'ref' (lvalue) property is explicitly specified or 'deref'
operations (like the '.' in "the latter language") explicitly given.
Janis