Use forget-all in forget-vocab

release
Slava Pestov 2007-10-09 17:41:35 -04:00
parent e13f6c3b5e
commit c64c2e8df8
2 changed files with 10 additions and 1 deletions

View File

@ -14,6 +14,15 @@ M: generic definition drop f ;
GENERIC: perform-combination ( word combination -- quot ) GENERIC: perform-combination ( word combination -- quot )
M: object perform-combination
#! We delay the invalid method combination error for a
#! reason. If we call forget-vocab on a vocabulary which
#! defines a method combination, a generic using this
#! method combination, and a method on the generic, and the
#! method combination is forgotten first, then forgetting
#! the method will throw an error. We don't want that.
nip [ "Invalid method combination" throw ] curry ;
: make-generic ( word -- ) : make-generic ( word -- )
dup dup
dup "combination" word-prop perform-combination dup "combination" word-prop perform-combination

View File

@ -76,7 +76,7 @@ SYMBOL: load-vocab-hook
[ ] subset ; [ ] subset ;
: forget-vocab ( vocab -- ) : forget-vocab ( vocab -- )
dup vocab-words [ nip forget ] assoc-each dup vocab-words values forget-all
vocab-name dictionary get delete-at ; vocab-name dictionary get delete-at ;
: child-vocab? ( prefix name -- ? ) : child-vocab? ( prefix name -- ? )