newRPL - build 1255 released! [updated to 1299]
|
06-07-2019, 02:45 PM
(This post was last modified: 06-07-2019 02:56 PM by Gilles.)
Post: #491
|
|||
|
|||
RE: newRPL - build 1255 released! [official and unofficial]
(06-04-2019 08:46 PM)Claudio L. Wrote:(06-04-2019 11:11 AM)Gilles Wrote: Not a priority at all and I know that DOSUBS or MAP do the job. But it could be nice to have a kind of FOR IN syntax : I thinked about STEP. It coud be something like this { 1 2 3 4 7 9 } FOR 'MyDigit' ... NEXT 'MyDigit' is 1 for the first loop, 2 for the next loop etc. { 1 2 3 4 7 9 } FOR 'MyDigits' ... 2 STEP 'MyDigits' is { 1 2 } for the fisrt loop and { 3 4 } for the second loop etc. { 1 { "a" "b"} 4 7 9 } FOR 'MyStuff' ... 2 STEP 'MyStuff' is { 1 {"a" "b"} } for the fisrt loop and { 4 7 } for the second loop etc. I like this because you can't do this easily with DOSUBS (with dosub we get 1 2 and 2 3 and 3 4 etc... For the last loop, the list may content less elements but it's not a problem. Negative step could do the same beginning by the end of the list. In this case, perhaps { 7 9 } and {3 4 } is better than { 9 7 } and { 4 3 } ? The keyword could be FOR or FOREACH. |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 9 Guest(s)