From: | neitzel@gaertner.de (Martin Neitzel) |
Newsgroups: | comp.compilers |
Date: | Mon, 7 Mar 2011 15:09:29 GMT |
Organization: | Gaertner Datensysteme, Braunschweig, Germany |
References: | 11-03-006 |
Keywords: | syntax, history |
Posted-Date: | 07 Mar 2011 11:55:22 EST |
> Does anyone know what the earliest languages supporting conditional
> assignment were?
Unlike the other followups, I understand the question not as one about
dynamic LHS determination but really as "conditional assignment".
The following conditional assignment idioms come to my mind:
(1) ICON [Griswold & Griswold, (1980ies)] knows a possible "&null" value
for (typically) uninitialized variables. The expression
(/x) := 22
will assign to x only if x is still &null so far. Contrarily,
(\x) := 22
will only overwrite x if set already. (Both expression "fail" otherwise
which is nothing catastrophic in ICON.)
(2) Bourne/POSIX sh (1970ies), pretty much the same:
${foo:=22} # assign default value if still null
(3) Assemblers: "test-and-set" instructions, most often used to implement
atomic locks. I draw a blank when I try to date this using wikipedia or
google. I remember to have had it available in a simulated /370.
Undoubtly, many variations of this must exist.
Martin Neitzel
[Test and set was in the S/360 architecture in the early 1960s. Dunno
if it was on earlier machines or if they just did it implicitly using
add to memory. -John]
Return to the
comp.compilers page.
Search the
comp.compilers archives again.