Handbook
Glossary
set-vocab-file-lines ( lines vocab name -- )
Factor handbook
»
The language
»
Vocabulary loader
»
Vocabulary metadata
Prev:
vocab-file-lines ( vocab name -- lines/f )
Vocabulary
vocabs
.
metadata
Inputs
lines
a
sequence
of lines
vocab
a vocabulary specifier
name
a
string
Outputs
None
Word description
Stores a sequence of lines to the file named
name
from the vocabulary's directory.
Definition
USING:
io.directories
io.encodings.utf8
io.files
kernel
memoize
sequences
vocabs
;
IN:
vocabs.metadata
:
set-vocab-file-lines
( lines vocab name -- )
dupd
vocab-file-path
or?
[
swap
[
?delete-file
]
[
swap
utf8
set-file-lines
]
if-empty
\
vocab-file-lines
reset-memoized
]
[
vocab-name
no-vocab
]
if
;