Mailing List Archive


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [tlug] "Assignment" "Expressions"





On 3 July 2018 at 21:25, Curt Sampson <cjs@example.com> wrote:
On 2018-07-03 16:57 +0900 (Tue), Stephen J. Turnbull wrote:

> 6.  People who have used professionally languages that have assignment
>     expressions (pure functional languages excluded) need not
>     apply. ;-)

Did you not mean to include assignment statements?

Some languages have assignment statements, but do not permit assignment within expressions.

For example Pascal has an assignment statement

x := 0

but does NOT permit assignment within an _expression_

if x := 0 then ... (* invalid *)

while C has an assignment _expression_

x=0

which is why you can do

if (x=0) { ...  /* valid */

In Pascal, the := assignment symbol is punctuation, not an operator. In C, the = assignment symbol is an operator.

Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links