Re: First language with conditional assignment?

neitzel@gaertner.de (Martin Neitzel)
Mon, 7 Mar 2011 15:09:29 GMT

          From comp.compilers

Related articles
[6 earlier articles]
Re: First language with conditional assignment? news@cuboid.co.uk (Andy Walker) (2011-03-05)
Re: First language with conditional assignment? monnier@iro.umontreal.ca (Stefan Monnier) (2011-03-05)
Re: First language with conditional assignment? derekrss@yahoo.ca (Derek) (2011-03-06)
Re: First language with conditional assignment? compilers@is-not-my.name (2011-03-07)
Re: First language with conditional assignment? compilers@is-not-my.name (2011-03-07)
Re: First language with conditional assignment? compilers@is-not-my.name (2011-03-07)
Re: First language with conditional assignment? neitzel@gaertner.de (2011-03-07)
Re: First language with conditional assignment? bc@freeuk.com (Bartc) (2011-03-07)
Re: First language with conditional assignment? alex.colvin@valley.net (mac) (2011-03-07)
Re: First language with conditional assignment? gah@ugcs.caltech.edu (glen herrmannsfeldt) (2011-03-07)
Re: First language with conditional assignment? robin51@dodo.com.au (robin) (2011-03-08)
Re: First language with conditional assignment? gah@ugcs.caltech.edu (glen herrmannsfeldt) (2011-03-08)
| List of all articles for this month |

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]



Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.