newRPL - Updated to build 1510 [official build remains at 1487]
|
08-11-2021, 02:31 PM
Post: #169
|
|||
|
|||
RE: newRPL - Updated to build 1487 [ including official build]
(08-10-2021 06:56 PM)Wes Loewer Wrote:(08-10-2021 06:29 PM)Claudio L. Wrote: I think we'll settle for the following (unless there's any objections): It wouldn't "require" anything, you are still free to use any STEP if you want to. The logic of FOR is a little quirky: FOR determines the direction of the loop from the start and end arguments: if start<end it assumes forward (positive) and vice versa. That implied direction determines the check that STEP uses, regardless of the actual value given to STEP. For example, 1 3 FOR K ... n STEP will assume a forward loop, and the comparison to end the loop is K<=3, regardless of the value of n. This allows a loop to backtrack the variable by using a negative STEP whenever needed. Is this automatic determination of the direction what prevents the loop from exiting early: it always does one run because (start <= end) or (start >= end) is always true for the chosen loop direction. The new proposal, providing the loop direction explicitly is the best solution. FORFWD will always use var<=end, therefore upon entry you can exit if start>end. Same for FORREV. Which name is best, FORFWD of FORUP, also FORREV or FORDN or FORDOWN? |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)