User-defined functions in Free42
|
01-13-2021, 11:21 PM
Post: #25
|
|||
|
|||
RE: User-defined functions in Free42
RTNERR already has the effect of restoring the stack completely, i.e. as if FUNC 00 had been called. Otherwise, the FUNC io mechanism seems flexible enough, since most functions always consume the same number of arguments and return the same number of results.
I toyed with the idea of adding special versions of XEQ and LBL as well, but ended up with FUNC and a small number of special RTN instructions because that seems to provide a good combination of flexibility and simplicity. Note that RTNYES, RTNNO, and RTNERR can also be used in subroutines that don't use FUNC, so any desired weird stack behavior can be coded manually even in combination with these new RTN variations. |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)