APL\360

Paul Koning paulkoning at comcast.net
Fri Jan 29 08:27:23 CST 2021



> On Jan 29, 2021, at 7:27 AM, Gavin Scott via cctalk <cctalk at classiccmp.org> wrote:
> 
> On Fri, Jan 29, 2021 at 6:11 AM Peter Corlett via cctalk
> <cctalk at classiccmp.org> wrote:
>> Secondly, beyond BODMAS, the meaning and precedence of random symbols is
>> unclear to casual readers.
> 
> An issue that plagues other operator-rich languages, but not APL since
> APL follows a strict right-to-left evaluation order for ALL operators
> (no BODMAS in sight). You can use parentheses to affect it, but it's
> not as hard to figure out a complex APL expression as one might
> naively expect at first glance.

True, although right to left is not a natural way to read mathematical formulas.  The reason APL uses right to left is that the designers apparently were unwilling to change the direction of the assignment operator, so everything else had to follow.  Another language that doesn't have precedence avoided this issue by changing assignment to match the others, i.e., everything is left to right.  That is POP-2, a language out of the U of Edinborough I remember from an AI class.  So it would do stuff like:

	a + 1 * 5 -> b

which in C would be

	b = (a + 1) * 5;

and is definitely easier to read than the APL equivalent.

   paul



More information about the cctalk mailing list