[net.lang] APL order of evaluation

daemon@decwrl.UUCP (11/21/83)

From: Ed Featherston  HL01-1/P06  225-5241 <roll::featherston>

 Begin Forwarded Message:
              -------------------------------------------

Newsgroup : net.lang
>From : ORPHAN::BLICKSTEIN
Organization : Digital Equipment Corp.
Subject: APL order of evaluation.

Your original program was correct.

First, your program contained no APL operators.   Operators in APL are 
quasi-functions that take other functions as arguments like +/ (reduction
is the operator and it has + as an argument).  The other operators are
compression, inner & outer product, etc.

APL functions are more than right associative.  They are evaluated right
to left.  this means that for I+I<-1 the assignment (assignment is a
function in APL) happens before the addition and so I has a value before
the arguments to addition are evaluated.

Also, there is a defined order for argument evaluation: right to left again.
This means that  (I <- 2) + I <-3 is 5, not 4.

Because of the right to left rule, any expression which contains two 
adjacent right parenthesis has redundant parenthesis, as in your corrected
version.

	Dave Blickstein

	Technical Languages
	Digital Equipment Corp.

		Mail address : ...decvax!decwrl!rhea!orphan!blickstein

              -------------------------------------------
 End Forwarded Message