diff --git a/core/generic/generic.factor b/core/generic/generic.factor index 018e8afd35..a9216a2fd3 100644 --- a/core/generic/generic.factor +++ b/core/generic/generic.factor @@ -14,6 +14,15 @@ M: generic definition drop f ; 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 -- ) dup dup "combination" word-prop perform-combination diff --git a/core/vocabs/vocabs.factor b/core/vocabs/vocabs.factor index cb5e700c40..0d3475c951 100644 --- a/core/vocabs/vocabs.factor +++ b/core/vocabs/vocabs.factor @@ -76,7 +76,7 @@ SYMBOL: load-vocab-hook [ ] subset ; : forget-vocab ( vocab -- ) - dup vocab-words [ nip forget ] assoc-each + dup vocab-words values forget-all vocab-name dictionary get delete-at ; : child-vocab? ( prefix name -- ? )