Handbook
Glossary
parse-hosts ( path -- hosts )
Vocabulary
etc-hosts
Inputs
path
an
object
Outputs
hosts
an
object
Definition
USING:
assocs
io.encodings.utf8
io.files
sequences
splitting
unicode
;
IN:
etc-hosts
:
parse-hosts
( path -- hosts )
utf8
file-lines
[
[
blank?
]
trim
]
map
harvest
[
"#"
head?
]
reject
[
[
blank?
]
split1-when
[
blank?
]
split-when
harvest
]
H{
}
map>assoc
;