Liste des Groupes | Revenir à cl c |
On 29/08/2024 21:30, Keith Thompson wrote:Bart <bc@freeuk.com> writes:>
[...]So what exactly is different about the LHS and RHS here:The RHS is evaluated to determine the current value stored in the
>
A = A;
object
named A. The LHS is evaluated to determine the object that's designated
by the name A; its current value is irrelevant.
Sure, but the same thing happens on both sides: one ends up performing
a Read via that Lvalue, and the other does a Write via that Lvalue.
In C terms, the RHS undergoes *lvalue conversion*, where an expression>
that's an lvalue is converted to the value stored in the designated
object. The LHS does not undergo lvalue conversion.
(In BLISS, doing the same thing requires 'A = .A' AIUI; while 'A = A'Because BLISS, unlike C, does not have implicit lvalue conversion;
is also valid, there is a hidden mismatch in indirection levels
between left and right. It is asymmetric while in C it is symmetric,
although seem to disagree on that latter point.)
the
prefix "." operator performs explicit lvalue conversion. I presume the
"." operator isn't specific to assignments.
But it must have that conversion on the LHS, otherwise it's A's
address that is written to rather than its value, which doesn't make
sense. That's why I said it was asymmetric; the RHS needs an explicit
operator, the LHS doesn't.
I'd initially thought that both sides needed it.
>In C, the LHS and RHS are evaluated differently. In BLISS, they're>
evaluated in the same way, requiring an explicit operator to do what
done implicitly by context in C. I'd call the former asymmetric and the
latter symmetric.
It sounds like you've got it backwards.
>
How can A = B be asymmetric, but A = .B be symmetric?
Les messages affichés proviennent d'usenet.