]> gitweb.factorcode.org Git - factor.git/commitdiff
vocabs.cache: reset-cache only when vocabs forgotten, not created.
authorJohn Benediktsson <mrjbq7@gmail.com>
Thu, 10 Nov 2016 00:50:14 +0000 (16:50 -0800)
committerJohn Benediktsson <mrjbq7@gmail.com>
Thu, 10 Nov 2016 00:50:14 +0000 (16:50 -0800)
basis/vocabs/cache/cache.factor

index 9947b3b8337bcdc8e47875cfdb2282864652503e..3e13393058d5ec0d5223708abb2db24ce5cfb96e 100644 (file)
@@ -18,7 +18,15 @@ IN: vocabs.cache
 
 SINGLETON: cache-observer
 
-M: cache-observer vocab-changed drop reset-cache ;
+<PRIVATE
+
+: forgot-vocab? ( vocab -- ? )
+    vocab-name dictionary get key? not ;
+
+PRIVATE>
+
+M: cache-observer vocab-changed
+    drop dup forgot-vocab? [ reset-cache ] [ drop ] if ;
 
 [
     f changed-vocabs set-global