Sujet : Re: QUIT and ABORT
De : dxforth (at) *nospam* gmail.com (dxf)
Groupes : comp.lang.forthDate : 05. May 2025, 05:11:54
Autres entêtes
Organisation : i2pn2 (i2pn.org)
Message-ID : <6a9a2b6e873c1b72bdec2c72749ef0aac6f33f42@i2pn2.org>
References : 1 2 3 4 5 6 7 8 9 10 11
User-Agent : Mozilla Thunderbird
On 4/05/2025 11:33 pm, Anton Ertl wrote:
...
Here's the code I give to the Forth systems:
1 .( a ) cr -56 throw .( b )
.s
2 .( a ) cr quit .( b )
.s
: foo 3 -56 throw ; ' foo catch 5
.s
: bar 4 quit ; ' bar catch 6
.s
Let's see what different Forth systems do:
...
In DX-Forth QUIT is not CATCHable thus -56 THROW simply returns:
a
THROW #-56
However modifying it to do so gives these results:
1 .( a ) cr -56 throw .( b )
'a' is displayed and the stack is: 1
2 .( a ) cr quit .( b )
'a' is displayed and the stack is: 2
: foo 3 -56 throw ; ' foo catch 5
stack is: -56 5
: bar 4 quit ; ' bar catch 6
stack is: -56 6