Post Reply 
newRPL - build 1255 released! [updated to 1299]
06-11-2019, 06:51 PM (This post was last modified: 06-11-2019 07:02 PM by Gilles.)
Post: #499
RE: newRPL - build 1255 released! [official and unofficial]
(06-11-2019 12:42 PM)Claudio L. Wrote:  EXIT will also return from the current program but it can only exit one program at a time. RPL has no function markers so there is no way to know how many secondaries RETURN is supposed to exit (…)
Quote:EXIT will also return from the current program but it can only exit one program at a time.

I'm not sure to understand your point. Perhaps I missed or misunderstand something. I thought that EXIT was something like BREAK in PPL, and my suggestion for RETURN was something like the RETURN in PPL.
For me EXIT dont return from the current program but exit the current loop (Or perhaps behind the scene a loop is a program in newRPL ?).
The idea of RETURN is different : stop the program (the subprogram) here and returns the stack "as it is" :

Exemple

Code:
«
 1 9 FOR 'a'
  1 9 FOR 'b'
   IF  a b + 4 == THEN a b RETURN END
  NEXT
 NEXT
»

-> 1 3

'a' loop is just executed once
'b' loop 3 times

But with EXIT

Code:
«
 1 9 FOR 'a'
  1 9 FOR 'b'
   IF  a b 4 + == THEN a b EXIT END
  NEXT
 NEXT
»
-> 1 3 2 2 3 1

The inner loop stops each time the condtion is true
The outer loop is executed 10 times
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: newRPL - build 1001 released! - pier4r - 12-16-2017, 08:03 AM
newRPL - on Hp 39gs - Martin Hepperle - 06-05-2019, 06:51 AM
RE: newRPL - build 1001 released! - pier4r - 12-23-2017, 10:16 AM
RE: newRPL - build 1001 released! - pier4r - 01-01-2018, 09:42 AM
t - Claudio L. - 01-01-2018, 03:06 PM
RE: newRPL - build 1001 released! - pier4r - 01-01-2018, 03:41 PM
RE: newRPL - build 1001 released! - pier4r - 01-02-2018, 04:54 PM
RE: newRPL - build 1001 released! - pier4r - 01-02-2018, 06:58 PM
newRPL - brickviking - 10-05-2018, 06:01 AM
RE: newRPL - build 1255 released! [official and unofficial] - Gilles - 06-11-2019 06:51 PM
How to participate? - erazor - 12-13-2019, 07:12 AM



User(s) browsing this thread: 3 Guest(s)