On Jan 29, 2021, at 12:12 PM, Chuck Guzis via cctalk
<cctalk at classiccmp.org> wrote:
On 1/29/21 6:27 AM, Paul Koning via cctalk wrote:
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.
Well, part of the confusion lies in the difference of "=" in mathematics
indicating a property or state, as opposed to computer languages using
it as an operator. It's a subtle distinction, but important.
D = 4AC in mathematics establishes a property of D, whereas
D = 4*A*C in BASIC, etc. means "multiply 4 by A, then take that result
and multiply it by the value of C and store the result into D.
APL treats the assignment as what it is--an operation. Why the RTL of
APL was chosen by Iverson, is a mystery; I agree. He was, as far as I
know, not native writer of Hebrew. I suppose we should be grateful
that he didn't specify APL as a boustrophedon.
You're correct about equality or identity vs. assignment, but that wasn't my
point. I should have used ALGOL rather than C as the "other language" example
to avoid introducing that angle.
Yes, the right to left thing is really strange, since it requires changing the usual order
of hundreds of operators to preserve the usual order of a single one, rather than serving
the majority as POP-2 does.
BTW, I don't really know Hebrew but doesn't it still write math LTR? I know they
write numbers that way.