Handbook
Glossary
write-file-line-endings ( lines endings -- )
Vocabulary
io
.
files
.
private
Inputs
lines
an
object
endings
an
object
Outputs
None
Definition
USING:
io
kernel
math
sequences
;
IN:
io.files.private
::
write-file-line-endings
( lines endings -- )
endings
[
empty?
not
]
find
nip
"\n"
or
:>
default-ending lines
[|
line i |
line
write
i lines
length
1
-
=
endings
empty?
not
and
[
endings
last
]
[
i endings
?nth
dup
empty?
[
drop
default-ending
]
when
]
if
[
write1
]
each
]
each-index
;