Use forget-all in forget-vocab
parent
e13f6c3b5e
commit
c64c2e8df8
|
@ -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
|
||||||
|
|
|
@ -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 -- ? )
|
||||||
|
|
Loading…
Reference in New Issue