--- gforth/look.fs 1996/08/26 10:07:20 1.6 +++ gforth/look.fs 1998/12/08 22:02:46 1.11 @@ -1,6 +1,6 @@ \ 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. @@ -28,10 +28,10 @@ decimal -: PrimStart ['] true >name ; - \ look 17may93jaw +\ rename to discover!!! + : (look) ( xt startlfa -- lfa flag ) false swap BEGIN @ dup @@ -41,11 +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 dup ??? <> - THEN ; + dup dictionary-end forthstart within + IF + PrimStart (look) + ELSE + >name dup ??? <> + THEN ; +[THEN] +[THEN]