Sujet : Re: Top 10 most common hard skills listed on resumes...
De : Keith.S.Thompson+u (at) *nospam* gmail.com (Keith Thompson)
Groupes : comp.lang.cDate : 26. Aug 2024, 20:30:55
Autres entêtes
Organisation : None to speak of
Message-ID : <87seurdqts.fsf@nosuchdomain.example.com>
References : 1 2 3 4 5 6 7 8 9 10
User-Agent : Gnus/5.13 (Gnus v5.13)
Ben Bacarisse <
ben@bsb.me.uk> writes:
Bart <bc@freeuk.com> writes:
BLISS is a rather strange language. For something supposedly low level than
C, it doesn't have 'goto'.
>
It is also typeless.
>
There is also a key feature that sets it apart from most HLLs: usually if
you declare a variable A, then you can access A's value just by writing A;
its address is automatically dereferenced.
>
Not always. This is where left- and right-evaluation came in. On the
left of an assignment A denotes a "place" to receive a value. On the
right, it denotes a value obtained from a place. CPL used the terms and
C got them via BCPL's documentation. Viewed like this, BLISS just makes
"evaluation" a universal concept.
As I recall, the terms "lvalue" and "rvalue" originated with CPL. The
'l' and 'r' suggest the left and right sides of an assignment.
Disclaimer: I have a couple of CPL documents, and I don't see the terms
"lvalue" and "rvalue" in a quick look. The PDFs are not searchable. If
someone has better information, please post it. Wikipedia does say that
the notion of "l-values" and "r-values" was introduced by CPL.
An expression could be "evaluated for its lvalue", which means
determining what object it designates, or "evaluted for its rvalue",
which C just calls evaluating the expression. An expression like 2+2
that does not designate an object does not have an lvalue.
So given `int foo = 42;`, in CPL terms evaluating `foo` for its lvalue
yields the identity of that object, and evaluating `foo` for its rvalue
yields the value 42.
C changed the meanings, so that a C lvalue is a kind of expression, not
the result of evaluating an expression. C doesn't use the term "rvalue"
except in one footnote: "What is sometimes called "rvalue" is in this
document described as the "value of an expression"."
C has implicit *lvalue conversion* which converts an lvalue (expression)
to the value stored in the designated object. Apparently BLISS requires
this conversion to be done explicitly. (I don't hate the idea.)
-- Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.comvoid Void(void) { Void(); } /* The recursive call of the void */