Make abort" functional in interpret mode. This behavior is undefined

by ANS Forth standard, but it's useful.

Also, define the constant true in a more strict way. C might garantee
2-complement math, but Forth doesn't.
This commit is contained in:
dcs 2000-06-12 16:42:02 +00:00
parent 0e4edb9ead
commit 87575284dc

View File

@ -31,20 +31,33 @@ decimal 32 constant bl
: spaces ( n -- ) 0 ?do space loop ;
: abort"
postpone if
postpone ."
postpone cr
-2
postpone literal
postpone throw
postpone endif
; immediate
: abort"
state @ if
postpone if
[char] " parse
postpone sliteral
postpone type
postpone cr
-2
postpone literal
postpone throw
postpone endif
else
[char] " parse
rot if
type
cr
-2 throw
else
2drop
then
then
; immediate
\ ** CORE EXT
0 constant false
-1 constant true
0 constant false
false invert constant true
: <> = 0= ;
: 0<> 0= 0= ;
: compile, , ;