Remove MIN and MAX from core
It isn't used in there anymore. Moved it to VE, the only place where it's used.
This commit is contained in:
parent
3171b03335
commit
3615944ffa
2
blk/126
2
blk/126
@ -1,5 +1,7 @@
|
|||||||
CREATE CMD 2 C, '$' C, 0 C,
|
CREATE CMD 2 C, '$' C, 0 C,
|
||||||
CREATE PREVPOS 0 , CREATE PREVBLK 0 ,
|
CREATE PREVPOS 0 , CREATE PREVBLK 0 ,
|
||||||
|
: MIN ( n n - n ) 2DUP > IF SWAP THEN DROP ;
|
||||||
|
: MAX ( n n - n ) 2DUP < IF SWAP THEN DROP ;
|
||||||
: acc@ ACC @ 1 MAX ;
|
: acc@ ACC @ 1 MAX ;
|
||||||
: num ACC @ SWAP _pdacc IF ACC ! ELSE DROP THEN ;
|
: num ACC @ SWAP _pdacc IF ACC ! ELSE DROP THEN ;
|
||||||
: nspcs ( n -- , spit n space ) 0 DO SPC LOOP ;
|
: nspcs ( n -- , spit n space ) 0 DO SPC LOOP ;
|
||||||
|
2
blk/354
2
blk/354
@ -3,8 +3,6 @@
|
|||||||
: 0< 32767 > ; : >= < NOT ; : <= > NOT ; : 0>= 0< NOT ;
|
: 0< 32767 > ; : >= < NOT ; : <= > NOT ; : 0>= 0< NOT ;
|
||||||
: >< ( n l h -- f ) 2 PICK > ( n l f ) ROT> > AND ;
|
: >< ( n l h -- f ) 2 PICK > ( n l f ) ROT> > AND ;
|
||||||
: =><= 2 PICK >= ( n l f ) ROT> >= AND ;
|
: =><= 2 PICK >= ( n l f ) ROT> >= AND ;
|
||||||
: MIN ( n n - n ) 2DUP > IF SWAP THEN DROP ;
|
|
||||||
: MAX ( n n - n ) 2DUP < IF SWAP THEN DROP ;
|
|
||||||
: NIP SWAP DROP ; : TUCK SWAP OVER ;
|
: NIP SWAP DROP ; : TUCK SWAP OVER ;
|
||||||
: -^ SWAP - ;
|
: -^ SWAP - ;
|
||||||
: C@+ ( a -- a+1 c ) DUP C@ SWAP 1+ SWAP ;
|
: C@+ ( a -- a+1 c ) DUP C@ SWAP 1+ SWAP ;
|
||||||
|
BIN
cvm/forth.bin
BIN
cvm/forth.bin
Binary file not shown.
@ -213,8 +213,6 @@ Shortcuts: 1+ 2+ 1- 2-
|
|||||||
=><= n l h -- f Push true if l <= n <= h
|
=><= n l h -- f Push true if l <= n <= h
|
||||||
CMP n1 n2 -- n Compare n1 and n2 and set n to -1, 0, or 1.
|
CMP n1 n2 -- n Compare n1 and n2 and set n to -1, 0, or 1.
|
||||||
n=0: a1=a2. n=1: a1>a2. n=-1: a1<a2.
|
n=0: a1=a2. n=1: a1>a2. n=-1: a1<a2.
|
||||||
MIN a b -- n Returns the lowest of a and b
|
|
||||||
MAX a b -- n Returns the highest of a and b
|
|
||||||
NOT f -- f Push the logical opposite of f
|
NOT f -- f Push the logical opposite of f
|
||||||
|
|
||||||
# Strings
|
# Strings
|
||||||
|
Loading…
Reference in New Issue
Block a user