Right to left question 
Author Message
 Right to left question

Quote:

>What was the logic behind expression evaluation going from right to left?
>What is the advantage of this?

Emmett McLean mentioned mechanics of parsing in response.

There is an original design answer:
In mathematics and most computer languages, assignment flows to the left:
the name on the left gets everything to the right.  If you permit
operations to perform on results of other operations, then as you pass
results from one operation to another operation in the same line, you're
effectively assigning arguments to each new operation.  Thus if you keep
assignment as right to left, performing a statement of progressive
assignments goes right to left.

APL was originally designed as a mathematical notation, to standardize
certain varying mathematical notation practices.  Mathematics and other
computer languages use the confusing multi-directional practice of left
to right evaluation in general, function precedence for right to left and
left to right in the same phrase, and right to left for assignment.  APL
cleans up this practice by just choosing one direction, following the
flow of progressive assignments.  This also has benefits of eliminating
precedence and many parentheses.  Precendence would be pretty silly for
50+ primitives.

/
Charles A. Schulz



Wed, 08 Jan 1997 01:57:30 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. Right, left, Right.

2. newbie question: left and right-rotation

3. Right to left cursor utility

4. Hebrew and Right-to-Left

5. left mouse button = right mouse button

6. How to make a check right before leaving a program

7. Relational Trees - ? Scroll Left to Right

8. bold, italic, underline and right & left alignment

9. Hove to shift page numbers from left to right side depending on even uneven pagenumber

10. LEFT AND RIGHT ARROWS TO CHANGE SORT ORDER

11. Have a Get as a calculator (right to left)

12. More MF.Fun WORD-RIGHT and WORD-LEFT

 

 
Powered by phpBB® Forum Software