Library
Module
Module type
Parameter
Class
Class type
with_in filename f
opens filename
and calls f g
, where g
is a generator of characters from the file. The generator is only valid within the scope in which f
is called.
with_lines filename f
opens file filename
and calls f g
, where g
is a generator that iterates on the lines from the file. Do not use the generator outside of the scope of f
write_to filename g
writes all strings from g
into the given file. It takes care of opening and closing the file. Does not add sep
after the last string.
Same as write_str
but with individual characters