version 1.4, 1996/05/13 16:37:01
|
version 1.12, 1999/01/03 21:48:37
|
Line 1
|
Line 1
|
\ LOOK.FS xt -> lfa 22may93jaw |
\ LOOK.FS xt -> lfa 22may93jaw |
|
|
\ Copyright (C) 1995 Free Software Foundation, Inc. |
\ Copyright (C) 1995,1996,1997 Free Software Foundation, Inc. |
|
|
\ This file is part of Gforth. |
\ This file is part of Gforth. |
|
|
Line 28
|
Line 28
|
|
|
decimal |
decimal |
|
|
\ >NAME PRIMSTART 22may93jaw |
|
|
|
\ : >name ( xt -- nfa ) |
|
\ BEGIN 1 chars - |
|
\ dup c@ alias-mask and |
|
\ UNTIL ; |
|
|
|
: PrimStart ['] true >name ; |
|
|
|
\ look 17may93jaw |
\ look 17may93jaw |
|
|
|
\ rename to discover!!! |
|
|
: (look) ( xt startlfa -- lfa flag ) |
: (look) ( xt startlfa -- lfa flag ) |
false swap |
false swap |
BEGIN @ dup |
BEGIN @ dup |
WHILE dup name> |
WHILE dup name>int |
3 pick = IF nip dup THEN |
3 pick = IF nip dup THEN |
REPEAT |
REPEAT |
drop nip |
drop nip |
dup 0<> ; |
dup 0<> ; |
|
|
|
|
|
\ !!! nicht optimal! |
|
[IFUNDEF] look |
|
has? ec [IF] |
|
|
|
has? rom |
|
[IF] |
|
: look |
|
dup [ unlock rom-dictionary area lock ] |
|
literal literal within |
|
IF |
|
>name dup ?? <> |
|
ELSE |
|
forth-wordlist @ (look) |
|
THEN ; |
|
[ELSE] |
|
: look ( cfa -- lfa flag ) |
|
>name dup ??? <> ; |
|
[THEN] |
|
|
|
[ELSE] |
|
|
|
: PrimStart ['] true >name ; |
|
|
: look ( cfa -- lfa flag ) |
: look ( cfa -- lfa flag ) |
dup forthstart < |
dup in-dictionary? |
IF PrimStart (look) |
IF |
ELSE >name true THEN ; |
>name dup ??? <> |
|
ELSE |
|
PrimStart (look) |
|
THEN ; |
|
|
|
[THEN] |
|
[THEN] |