 
 : update-manifest ( manifest -- )
     [ dup [ name>> lookup-vocab ] when ] change-current-vocab
-    [ [ drop lookup-vocab ] assoc-filter ] change-search-vocab-names
-    dup search-vocab-names>> keys [ lookup-vocab ] V{ } map-as >>search-vocabs
+    [ members [ lookup-vocab ] filter dup fast-set ] change-search-vocab-names
+    swap [ lookup-vocab ] V{ } map-as >>search-vocabs
     qualified-vocabs>> [ update ] filter! drop ;
 
 M: manifest definitions-changed ( assoc manifest -- )

    [ set-current-vocab ] [ drop ] if ;

: using-vocab? ( vocab -- ? )
    vocab-name manifest get search-vocab-names>> key? ;

: use-vocab ( vocab -- )
    dup using-vocab?
    [ vocab-name "Already using ``" "'' vocabulary" surround note. ] [
        manifest get
        [ [ load-vocab ] dip search-vocabs>> push ]
        [ [ vocab-name ] dip search-vocab-names>> conjoin ]
        2bi
    ] if ;


! Slava Pestov.
! See http://factorcode.org/license.txt for BSD license.
USING: accessors arrays assocs combinators compiler.units
continuations hash-sets hashtables kernel math namespaces
parser.notes sequences sets sorting splitting vectors vocabs
words ;
IN: vocabs.parser

ERROR: no-word-error name ;
