1
0
mirror of https://github.com/hsoft/collapseos.git synced 2024-11-27 15:08:05 +11:00

Rename (find) to FIND

I hadn't noticed that this word was almost ANS compliant.
This commit is contained in:
Virgil Dupras 2020-05-15 12:50:14 -04:00
parent 175b4bc497
commit db9885b8cf
11 changed files with 11 additions and 20 deletions

View File

@ -10,7 +10,7 @@ Entry management
, n -- Write n in HERE and advance it. , n -- Write n in HERE and advance it.
ALLOT n -- Move HERE by n bytes ALLOT n -- Move HERE by n bytes
C, b -- Write byte b in HERE and advance it. C, b -- Write byte b in HERE and advance it.
FIND w -- a f Like '?, but for w.
EMPTY -- Rewind HERE and CURRENT where they were at EMPTY -- Rewind HERE and CURRENT where they were at
system initialization. system initialization.
(cont.) (cont.)

View File

@ -1,9 +0,0 @@
( Relink a regular Forth full interpreter. )
: RLCORE
LIT< [ (find) DROP ( target )
DUP 3 - @ ( t prevoff )
( subtract [ name length )
1- ( t o )
RLDICT
;

View File

@ -1,4 +1,4 @@
: EMPTY : EMPTY
LIT< _sys (find) NOT IF ABORT THEN LIT< _sys FIND NOT IF ABORT THEN
DUP HERE ! CURRENT ! ; DUP HERE ! CURRENT ! ;

View File

@ -11,5 +11,5 @@ VARIABLE XCURRENT
: X['] XCON ' _xapply LITA XCOFF ; : X['] XCON ' _xapply LITA XCOFF ;
: XCOMPILE : XCOMPILE
XCON ' _xapply LITA XCON ' _xapply LITA
LIT< , (find) DROP _xapply , XCOFF ; LIT< , FIND DROP _xapply , XCOFF ;
: X[COMPILE] XCON ' _xapply , XCOFF ; : X[COMPILE] XCON ' _xapply , XCOFF ;

View File

@ -6,11 +6,11 @@
: XYPOS 0x40 RAM+ ; : XYPOS 0x40 RAM+ ;
( w -- a f ) ( w -- a f )
: (find) CURRENT @ SWAP _find ; : FIND CURRENT @ SWAP _find ;
: QUIT : QUIT
(resRS) (resRS)
0 0x08 RAM+ ! ( 08 == C<* override ) 0 0x08 RAM+ ! ( 08 == C<* override )
LIT< (main) (find) DROP EXECUTE LIT< (main) FIND DROP EXECUTE
; ;
1 25 LOADR+ ( xcomp core low ) 1 25 LOADR+ ( xcomp core low )

View File

@ -1,5 +1,5 @@
: ABORT (resSP) QUIT ; : ABORT (resSP) QUIT ;
: ERR LIT< (print) (find) IF EXECUTE THEN ABORT ; : ERR LIT< (print) FIND IF EXECUTE THEN ABORT ;
: = CMP NOT ; : < CMP -1 = ; : > CMP 1 = ; : = CMP NOT ; : < CMP -1 = ; : > CMP 1 = ;
: 0< 32767 > ; : >= < NOT ; : <= > NOT ; : 0>= 0< NOT ; : 0< 32767 > ; : >= < NOT ; : <= > NOT ; : 0>= 0< NOT ;
: >< ( n l h -- f ) 2 PICK > ( n l f ) ROT ROT > AND ; : >< ( n l h -- f ) 2 PICK > ( n l f ) ROT ROT > AND ;

View File

@ -4,5 +4,5 @@
(parseb) IF EXIT THEN (parseb) IF EXIT THEN
(parsed) IF EXIT THEN (parsed) IF EXIT THEN
( nothing works ) ( nothing works )
LIT< (wnf) (find) IF EXECUTE ELSE ABORT THEN LIT< (wnf) FIND IF EXECUTE ELSE ABORT THEN
; ;

View File

@ -1,7 +1,7 @@
: '? WORD (find) ; : '? WORD FIND ;
: ' : '
'? (?br) [ 4 , ] EXIT '? (?br) [ 4 , ] EXIT
LIT< (wnf) (find) DROP EXECUTE LIT< (wnf) FIND DROP EXECUTE
; ;
: ROLL : ROLL
DUP NOT IF EXIT THEN DUP NOT IF EXIT THEN

View File

@ -1,7 +1,7 @@
: INTERPRET : INTERPRET
BEGIN BEGIN
WORD DUP C@ EOT? IF DROP EXIT THEN WORD DUP C@ EOT? IF DROP EXIT THEN
(find) NOT IF (parse) ELSE EXECUTE THEN FIND NOT IF (parse) ELSE EXECUTE THEN
C<? NOT IF SPC LIT< ok (print) NL THEN C<? NOT IF SPC LIT< ok (print) NL THEN
AGAIN ; AGAIN ;
( Read from BOOT C< PTR and inc it. ) ( Read from BOOT C< PTR and inc it. )

View File

@ -9,7 +9,7 @@
(entry) (entry)
[ 14 ( == compiledWord ) LITN ] C, [ 14 ( == compiledWord ) LITN ] C,
BEGIN BEGIN
WORD (find) WORD FIND
IF ( is word ) DUP IMMED? IF EXECUTE ELSE , THEN IF ( is word ) DUP IMMED? IF EXECUTE ELSE , THEN
ELSE ( maybe number ) (parse) LITN THEN ELSE ( maybe number ) (parse) LITN THEN
AGAIN ; AGAIN ;

Binary file not shown.