vocab-file-contents ( vocab name -- seq )
Factor documentation > Factor handbook > The language > Vocabulary loader > Vocabulary metadata
Prev:set-vocab-resources ( patterns vocab -- )
Next:set-vocab-file-contents ( seq vocab name -- )


Vocabulary
vocabs.metadata

Inputs and outputs
vocaba vocabulary specifier
namea string
seqa sequence of lines, or f


Word description
Outputs the contents of the file named name from the vocabulary's directory, or f if the file does not exist.

Definition
USING: io.encodings.utf8 io.files kernel memoize vocabs.loader
;

IN: vocabs.metadata

MEMO: vocab-file-contents ( vocab name -- seq )
vocab-append-path dup
[ dup exists? [ utf8 file-lines ] [ drop f ] if ] when ;