Handbook
Glossary
write-ini ( assoc -- )
Vocabulary
ini-file
Inputs
assoc
an
assoc
Outputs
None
Word description
Writes a configuration to the
output-stream
in the INI format.
Definition
USING:
assocs
formatting
ini-file.private
io
kernel
strings
;
IN:
ini-file
:
write-ini
( assoc -- )
[
dup
string?
[
[
escape-quoted
]
bi@
"%s=%s\n"
printf
]
[
[
escape-quoted
"[%s]\n"
printf
]
dip
[
[
escape-quoted
]
bi@
"%s=%s\n"
printf
]
assoc-each
nl
]
if
]
assoc-each
;