diff --git a/core/vocabs/loader/loader.factor b/core/vocabs/loader/loader.factor index 26a6e8ae7a..3d97dd4cc7 100755 --- a/core/vocabs/loader/loader.factor +++ b/core/vocabs/loader/loader.factor @@ -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 ;