Skip to content
Eric Holk edited this page May 5, 2015 · 3 revisions

Core Library

These libraries are included in every Harlan program, providing what is considered essential in any program.

Syntax

Functions


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 by open_outfile.

Return Value: None.

IO

The IO library provides support for reading and writing files.

Usage:

(import io)

Functions


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.

Graphics

Foreign Function Interface