Re: First language with conditional assignment?

glen herrmannsfeldt <gah@ugcs.caltech.edu>
Fri, 4 Mar 2011 20:50:53 +0000 (UTC)

          From comp.compilers

Related articles
First language with conditional assignment? compilers@is-not-my.name (2011-03-03)
Re: First language with conditional assignment? nmh@t3x.org (Nils M Holm) (2011-03-04)
Re: First language with conditional assignment? gah@ugcs.caltech.edu (glen herrmannsfeldt) (2011-03-04)
Re: First language with conditional assignment? cr88192@hotmail.com (BGB) (2011-03-04)
Re: First language with conditional assignment? kym@kymhorsell.com (2011-03-05)
Re: First language with conditional assignment? robin51@dodo.com.au (robin) (2011-03-05)
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)
[9 later articles]
| List of all articles for this month |

From: glen herrmannsfeldt <gah@ugcs.caltech.edu>
Newsgroups: comp.compilers
Date: Fri, 4 Mar 2011 20:50:53 +0000 (UTC)
Organization: A noiseless patient Spider
References: 11-03-006
Keywords: syntax, history
Posted-Date: 04 Mar 2011 23:54:51 EST

compilers@is-not-my.name wrote:


> Does anyone know what the earliest languages supporting conditional
> assignment were? Although the construct is useful I don't like the syntax in
> C-like languages. I am curious if there were earlier examples and what the
> syntax was.


ALGOL, I believe ALGOL 60 (I don't know the versions very well)
has the "conditional arithmetic expression" as:


      A := IF I<0 THEN R ELSE 3;


That is the example from Baumann, et. al, "Introduction
to ALGOL" from 1964, I believe describing ALGOL 60.
I don't know when it originated in ALGOL.


For my undergrad compiler class we used ALGOL, or DEC's
version of it, on the PDP-10, and I do remember using
some of conditional expressions.


(Note that the term "conditional assignment" might be used
to describe the C construct if(a) b=c; and that many RISC
architectures have a "conditional load" instruction that allows
doing conditional operations without branching.)


-- glen



Post a followup to this message

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