Liste des Groupes | Revenir à cl c |
On 06.09.2024 13:34, Bart wrote:Yes, that's my syntax too as that's where I copied it from. I've been able to write such code since the 80s.>In Algol 68 you can write
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;
IF c THEN a ELSE b FI := x
or, in a shorter form, as
( c | a | b ) := x
if you prefer.
This is where I differ from Algol68, where I had to considerably simplify the semantics to get something I could understand and implement.>This is only a "visual" symmetry, not a semantical one.
So this assigns to either a or b depending on c. My implementation
effectively turns it into this:
>
*(c ? &a : &b) = x;
>
So using explicit references and derefs. However, that is internal. The
symmetry still exists in the syntax:
>
(c ? a : b) = (c ? a : b);
The LHS of the Algol 68 example is of 'REF' (lvalue) type, as it would
be the case with a language that supports a syntax as you show it here.
I'm not sure if you should adjust your wording (concerning "symmetry")
given that you seem to widely inflict confusion here.
Janis
Les messages affichés proviennent d'usenet.