--- gforth/look.fs 1996/08/21 14:58:42 1.5 +++ gforth/look.fs 1997/08/31 19:31:29 1.9 @@ -28,17 +28,10 @@ decimal -\ >NAME PRIMSTART 22may93jaw - -\ : >name ( xt -- nfa ) -\ BEGIN 1 chars - -\ dup c@ alias-mask and -\ UNTIL ; - -: PrimStart ['] true >name ; - \ look 17may93jaw +\ rename to discover!!! + : (look) ( xt startlfa -- lfa flag ) false swap BEGIN @ dup @@ -48,8 +41,37 @@ decimal drop nip 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 ) - dup forthstart < - IF PrimStart (look) - ELSE >name true THEN ; + dup dictionary-end forthstart within + IF + PrimStart (look) + ELSE + >name dup ??? <> + THEN ; +[THEN] +[THEN]