]> gitweb.factorcode.org Git - factor.git/commitdiff
vocabs.cache: clear only the vocab that changed from vocab-file-contents.
authorJohn Benediktsson <mrjbq7@gmail.com>
Mon, 13 Aug 2012 19:24:14 +0000 (12:24 -0700)
committerJohn Benediktsson <mrjbq7@gmail.com>
Mon, 13 Aug 2012 19:24:14 +0000 (12:24 -0700)
basis/vocabs/cache/cache.factor

index 071707462399b9442682c0476745fb12c1a50f26..e77e8c5217cd377c582587a9262d6b34f726f8b4 100644 (file)
@@ -1,12 +1,17 @@
 ! Copyright (C) 2009 Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
 USING: assocs kernel namespaces memoize init sequences vocabs
-vocabs.hierarchy vocabs.loader vocabs.metadata vocabs.refresh ;
+vocabs.hierarchy vocabs.loader vocabs.metadata vocabs.refresh
+words ;
 IN: vocabs.cache
 
 : reset-cache ( vocab -- )
-    vocab-name root-cache get-global delete-at
-    \ vocab-file-contents reset-memoized
+    vocab-name
+    [ root-cache get-global delete-at ]
+    [
+        \ vocab-file-contents "memoize" word-prop
+        [ drop [ first vocab-name ] [ = not ] bi* ] with assoc-filter! drop
+    ] bi
     \ all-vocabs-recursive reset-memoized
     \ all-authors reset-memoized
     \ all-tags reset-memoized ;