6.1.0670 ABORT CORE

( i * x -- ) ( R: j * x -- )

Empty the data stack and perform the function of QUIT, which includes emptying the return stack, without displaying a message.

See:

ContributeContributions

ruvavatar of ruv [356] State of other stacks after ABORTRequest for clarification2024-08-08 13:37:48

Should not abort empty the control-flow stack and the floating-point stack (like it does for the data stack)? The specification does not say anything about that.

The control-flow and floating-point stack were allow to be united with the data stack in Forth-94, therefore it was difficult to empty one and not empty another, when they are united. So, this was probably missed in Forth-94.

Typically, abort empties all three of these stacks.

AntonErtlavatar of AntonErtl

Yes, I think that abort should empty the control-flow stack and the floating-point stack, and the document should be amended to specify that. The former is easy to specify, the latter has the complication that the core system has no floating-point stack. I still would specify it with the core abort rather than having an additional FP version of abort; such redefinitions have produced confusion among readers of the standard document in the past.

soundwaveavatar of soundwave

Language similar to "empty the floating-point stack if it exists" has been used elsewhere and seems clear.

Reply New Version