-
Notifications
You must be signed in to change notification settings - Fork 82
The Harlan Library
Eric Holk edited this page May 5, 2015
·
3 revisions
These libraries are included in every Harlan program, providing what is considered essential in any program.
open_outfile :: (str) -> (ptr ofstream)
Arguments:
-
name :: str
- The name of the file to open.
Return Value: A file pointer that can be used with close_outfile
and as a target for print
and println
.
close_outfile :: ((ptr ofstream)) -> void
Arguments:
-
file :: (ptr ofstream)
- A file to close. This should have been returned byopen_outfile
.
Return Value: None.
The IO library provides support for reading and writing files.
Usage:
(import io)
file-open :: (str) -> (ptr file)
Opens a file for reading.
Arguments:
-
filename :: str
- The name of the file to open.
Return Value: A pointer to a file object that can be used for further IO functions.
file-read-float :: (ptr file) -> float
Reads and parses a floating point number from a file.
Arguments:
-
file :: (ptr file)
- The file to read from.
Return Value: A floating point number that was read from the file.