Handbook
Glossary
vocab-file-lines ( vocab name -- lines/f )
Factor handbook
»
The language
»
Vocabulary loader
»
Vocabulary metadata
Prev:
vocab-tags ( vocab -- tags )
Next:
set-vocab-file-lines ( lines vocab name -- )
Vocabulary
vocabs
.
metadata
Inputs
vocab
a vocabulary specifier
name
a
string
Outputs
lines/f
a
sequence
of lines or
f
Word description
Outputs the lines 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
sequences
;
IN:
vocabs.metadata
MEMO:
vocab-file-lines
( vocab name -- lines/f )
vocab-file-path
dup
[
dup
file-exists?
[
utf8
file-lines
harvest
]
[
drop
f
]
if
]
when
;