Rename do-what-i-mean? to auto-use?

db4
Slava Pestov 2008-11-20 20:35:01 -06:00
parent 2620a10107
commit 98d109a9a8
1 changed files with 9 additions and 6 deletions

View File

@ -82,17 +82,20 @@ ERROR: no-word-error name ;
SYMBOL: amended-use? SYMBOL: amended-use?
SYMBOL: do-what-i-mean? SYMBOL: auto-use?
: no-word-restarted ( restart-value -- word ) : no-word-restarted ( restart-value -- word )
dup word? dup word? [
[ amended-use? on dup vocabulary>> (use+) ] amended-use? on
[ create-in ] dup vocabulary>>
if ; [ (use+) ] [
"Added ``" swap "'' vocabulary to search path" 3append note.
] bi
] [ create-in ] if ;
: no-word ( name -- newword ) : no-word ( name -- newword )
dup words-named [ forward-reference? not ] filter dup words-named [ forward-reference? not ] filter
dup length 1 = do-what-i-mean? get and dup length 1 = auto-use? get and
[ nip first no-word-restarted ] [ nip first no-word-restarted ]
[ <no-word-error> throw-restarts no-word-restarted ] [ <no-word-error> throw-restarts no-word-restarted ]
if ; if ;