vocabs.cache: clear only the vocab that changed from vocab-file-contents.

db4
John Benediktsson 2012-08-13 12:24:14 -07:00
parent 33c4e19ff9
commit 9ac33a06bc
1 changed files with 8 additions and 3 deletions

View 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 ;