From: | "Bartc" <bc@freeuk.com> |
Newsgroups: | comp.compilers |
Date: | Mon, 7 Mar 2011 15:32:15 -0000 |
Organization: | A noiseless patient Spider |
References: | 11-03-006 11-03-014 |
Keywords: | syntax, history |
Posted-Date: | 07 Mar 2011 11:56:01 EST |
"robin" <robin51@dodo.com.au> wrote in message
>
>>Does anyone know what the earliest languages supporting conditional
>>assignment were?
>
> There's Algol from c. 1960, with things like:
>
> a := if e > f then b else c;
>
> As for me, I don't like conditional assignments,
> much preferring the traditional form --
>
> if e > f then a := b else a := c;
Neither of those look like conditional assignments to me. Both seem to be
unconditional assignments, so that a ends up with a new value (b or c) in
either case.
(The if e>f bit is just a form of expression, which could just as well
appear anywhere else.)
However, I can't offer an alternative syntax other than:
if e>f then a:=b
which, written perhaps as:
(e>f | a:=b)
can't get much that much more compact.
--
Bartc
[See the Icon example. -John]
Return to the
comp.compilers page.
Search the
comp.compilers archives again.