Don't store f in vocab root cache

db4
Slava Pestov 2008-08-25 02:09:45 -05:00
parent 8c46a3d56f
commit a8560f0f57
1 changed files with 4 additions and 3 deletions

View File

@ -34,10 +34,11 @@ SYMBOL: root-cache
H{ } clone root-cache set-global
: (find-vocab-root) ( name -- path/f )
vocab-roots get swap [ vocab-dir? ] curry find nip ;
: find-vocab-root ( vocab -- path/f )
vocab-name root-cache get [
vocab-roots get swap [ vocab-dir? ] curry find nip
] cache ;
vocab-name dup root-cache get at [ ] [ (find-vocab-root) ] ?if ;
: vocab-append-path ( vocab path -- newpath )
swap find-vocab-root dup [ prepend-path ] [ 2drop f ] if ;