2020-04-06 06:11:17 +10:00
|
|
|
( Words useful for complex comparison operations )
|
|
|
|
|
2020-04-07 10:59:55 +10:00
|
|
|
: >= < NOT ;
|
|
|
|
: <= > NOT ;
|
2020-04-16 02:29:47 +10:00
|
|
|
: <0 32767 > ;
|
|
|
|
: >=0 <0 NOT ;
|
2020-04-07 10:59:55 +10:00
|
|
|
|
2020-04-06 06:11:17 +10:00
|
|
|
( n1 -- n1 true )
|
|
|
|
: <>{ 1 ;
|
|
|
|
|
|
|
|
( n1 f -- f )
|
|
|
|
: <>} SWAP DROP ;
|
|
|
|
|
2020-04-06 07:36:07 +10:00
|
|
|
|
|
|
|
: _|&
|
|
|
|
( n1 n2 cell )
|
|
|
|
>R >R DUP R> R> ( n1 n1 n2 cell )
|
|
|
|
@ EXECUTE ( n1 f )
|
|
|
|
;
|
|
|
|
|
|
|
|
( n1 f n2 -- n1 f )
|
|
|
|
: _|
|
|
|
|
CREATE , DOES>
|
|
|
|
( n1 f n2 cell )
|
|
|
|
ROT IF 2DROP 1 EXIT THEN ( n1 true )
|
|
|
|
_|&
|
2020-04-06 06:11:17 +10:00
|
|
|
;
|
|
|
|
|
2020-04-06 07:36:07 +10:00
|
|
|
: _&
|
|
|
|
CREATE , DOES>
|
|
|
|
( n1 f n2 cell )
|
|
|
|
ROT NOT IF 2DROP 0 EXIT THEN ( n1 true )
|
|
|
|
_|&
|
2020-04-06 06:11:17 +10:00
|
|
|
;
|
|
|
|
|
|
|
|
( All words below have this signature:
|
|
|
|
n1 f n2 -- n1 f )
|
2020-04-06 07:36:07 +10:00
|
|
|
' = _| |=
|
|
|
|
' = _& &=
|
|
|
|
' > _| |>
|
|
|
|
' > _& &>
|
|
|
|
' < _| |<
|
|
|
|
' < _& &<
|