Next: , Previous: Floating point stack, Up: Stack Manipulation


5.6.3 Return stack

A Forth system is allowed to keep local variables on the return stack. This is reasonable, as local variables usually eliminate the need to use the return stack explicitly. So, if you want to produce a standard compliant program and you are using local variables in a word, forget about return stack manipulations in that word (refer to the standard document for the exact rules).

>r       w – R:w        core       “to-r”

r>       R:w – w        core       “r-from”

r@       – w ; R: w – w         core       “r-fetch”

rdrop       R:w –        gforth       “rdrop”

2>r       d – R:d        core-ext       “two-to-r”

2r>       R:d – d        core-ext       “two-r-from”

2r@       R:d – R:d d        core-ext       “two-r-fetch”

2rdrop       R:d –        gforth       “two-r-drop”