Re: First language with conditional assignment?

"robin" <robin51@dodo.com.au>
Tue, 8 Mar 2011 08:28:46 +1100

          From comp.compilers

Related articles
[10 earlier articles]
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: "robin" <robin51@dodo.com.au>
Newsgroups: comp.compilers
Date: Tue, 8 Mar 2011 08:28:46 +1100
Organization: Compilers Central
References: 11-03-006 11-03-014 11-03-016
Keywords: history, syntax
Posted-Date: 08 Mar 2011 15:03:26 EST

Stefan Monnier <monnier@iro.umontreal.ca>
>It's very sad that programmers are trained to artificially separate the
>world into "statements" and "expressions" and hence end up, as above,
>preferring the less precise and more redundant form.


There's nothing artificial about "statements" and "expressions".
Those are the building block of a program. And if they are
well-defined, a programmer has a better chance of writing a clear and
understandable program that actually works.


>To me
>
> a := if e > f then b else c;
>
>has various advantages, e.g.:
>- common subexpression elimination.


Well, no, and there a conditional in the middle of the assignment.


Things that are made easy for the compiler are not usually
easier for the programmer.


>- make it blatantly obvious that this whole thing sets `a' without
> having to check what each branch does.


The first form (viz., if e > f then a := b else a := c;) also does that.
[This is definitely into semicolon land. Some languages have statements,
some are all expressions. -John]



Post a followup to this message

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