words ;
IN: vocabs.cache
-: reset-cache ( vocab -- )
+: reset-vocab-cache ( vocab -- )
vocab-name
[ root-cache get delete-at ]
[
\ vocab-file-lines "memoize" word-prop swap
'[ drop first vocab-name _ = ] assoc-reject! drop
- ] bi
+ ] bi ;
+
+: reset-disk-cache ( -- )
\ all-disk-vocabs-recursive reset-memoized
\ all-authors reset-memoized
\ all-tags reset-memoized ;
+: reset-cache ( vocab -- )
+ reset-vocab-cache reset-disk-cache ;
+
SINGLETON: cache-observer
<PRIVATE
PRIVATE>
M: cache-observer vocab-changed
- drop dup forgot-vocab?
- [ reset-cache ]
- [ drop \ all-disk-vocabs-recursive reset-memoized ] if ;
+ drop dup forgot-vocab? [ reset-vocab-cache ] [ drop ] if
+ reset-disk-cache ;
[
f changed-vocabs set-global