newRPL - Updated to build 1510 [official build remains at 1487]
|
08-09-2021, 09:39 PM
Post: #162
|
|||
|
|||
RE: newRPL - Updated to build 1487 [ including official build]
(08-09-2021 07:25 PM)Wes Loewer Wrote: Okay, will do. The following aren't bugs but rather more design decision questions. I don't oppose to having an alias, but if it has more than 3 letters it's harder to type, so I would personally never use it! (08-09-2021 07:25 PM)Wes Loewer Wrote: Another quirk of the 50g that I found annoying when programming was the behavior of the FOR and START loops in that they alway execute at least once, even when the condition would indicated that the loop should not be executed at all. This is a very fundamental behavior of RPL. Breaking + and ADD affects only a few programs and it's a relatively easy fix. Changing the behavior of loops means almost EVERY program would be affected, and they would all need to be rewritten. So I'd keep FOR the way it is, but I agree with Sylvain nothing prevents creating a new loop structure. The problem with FOR is because the STEP is not known until you reach that statement, so the check cannot be done at the beginning. Maybe: Code:
This would be exactly like performing an additional STEP instruction before the FOR, which would exit the loop if the limits are in the wrong direction, and enter the loop otherwise (without actually doing the STEP in the counter). This solution could easily be intermixed with the standard FOR NEXT and STEP instructions. Another completely different direction would be to implement a more generic FOR (C-Style): Code:
In this case, STARTFOR takes 3 arguments. It EVALs the first, then EVALs the test clause before entering the loop, then ENDFOR will EVAL increment clause, then test clause, then restart the loop. But it becomes very similar to the DO ... UNTIL ... END, or WHILE ... REPEAT ... END loop, so I'm not convinced it's worth adding something like this. |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 3 Guest(s)