According to the original intention, the word quit in no way returns control to the caller.
Mitch Bradley, who was Vice Chair of the ANS FORTH committee, wrote in 1992 in comp.lang.forth:
the description of THROW says that, in the absence of explicitly-installed CATCH handlers, the behavior is like ABORT which eventually does the function of QUIT. An implementation of QUIT could do a "preemptive CATCH" and still be within the standard. This isn't surprising; a program that calls QUIT cannot expect to ever regain control anyway.
And quit is usually implemented in such a way that it never returns control.
But according to the specification (in Forth-1994 and Forth-2012), it shall return control if there is an exception frame on the exception stack and throw is performed by the user interactively. An example of call quit with an exception frame:
Such behavior (i.e., a way to return control) was not intended, and usually is not implemented. So, it's an omission in the specification for quit. This specification should be corrected to say that quitempties the exception stack.
According to the original intention, the word
quit
in no way returns control to the caller.Mitch Bradley, who was Vice Chair of the ANS FORTH committee, wrote in 1992 in comp.lang.forth:
And
quit
is usually implemented in such a way that it never returns control.But according to the specification (in Forth-1994 and Forth-2012), it shall return control if there is an exception frame on the exception stack and
throw
is performed by the user interactively. An example of callquit
with an exception frame:Such behavior (i.e., a way to return control) was not intended, and usually is not implemented. So, it's an omission in the specification for
quit
. This specification should be corrected to say thatquit
empties the exception stack.See also