[comp.lang.forth] Return stack munging

wmb@MITCH.ENG.SUN.COM (Mitch Bradley) (08/26/90)

> Both Len Morgenstern and Mitch Bradley have recently posted error
> handling mechanisms using these words (SP@ , RP@, SP!, RP!)

My *example* implementation of CATCH and THROW uses RP@ and RP! .
The *specification* of CATCH and THROW does not depend upon their
existence.  (BTW, the data stack manipulation part of CATCH and
THROW can be implemented using only DUP , DROP , and DEPTH ).

That is why CATCH and THROW are in the standard, because you can't
implement them using only standard words.  Since CATCH and THROW
are in the standard, it is up to the system vendor to supply them,
using whatever implementation technique is appropriate for his system.

The use of CATCH and THROW is standard and portable.  Any particular
implementation is not necessarily portable to all systems.

Obviously, CATCH and THROW wouldn't be necessary if RP@ and RP! were
in the standard.  RP@ and RP! are out because the committee voted not
to require addressability into the return stack.  That would have
eliminated Forth chips with hardware return stacks.

Mitch