core
IO
EOF
external
Char
the End-Of-File character as a literal.
color
defn
(λ [&String] ())
(color cname)
sets the output color using ANSI coloration based on a color name cname
.
colorize
defn
(λ [&String, &String] ())
(colorize cname s)
wraps a string in ANSI coloration based on a color name cname
and prints it.
error
doc-stub
a
prints a string ref to stderr, does not append a newline.
errorln
external
(λ [&String] ())
prints a string ref to stderr, appends a newline.
exit
external
(λ [Int] a)
exit the current program with a return code.
fclose
external
(λ [(Ptr FILE)] ())
closes a file pointer.
fflush
external
(λ [(Ptr FILE)] ())
flushes a file pointer (i.e. commits every write).
fgetc
external
(λ [(Ptr FILE)] Char)
gets a character from a file pointer.
fopen
external
(λ [&String, &String] (Ptr FILE))
opens a file by name using a mode (one or multiple of [r]ead, [w]rite, and [a]ppend), returns a file pointer.
fread
external
(λ [a, Int, Int, (Ptr FILE)] Int)
reads from a file pointer into a pointer.
fseek
external
(λ [(Ptr FILE), Int, Int] ())
sets the position indicator of a file.
ftell
external
(λ [(Ptr FILE)] Int)
gets the position indicator of a file.
fwrite
external
(λ [a, Int, Int, (Ptr FILE)] ())
writes to a file pointer.
get-char
external
(λ [] Char)
gets a character from stdin.
get-line
external
(λ [] String)
gets a line from stdin.
print
external
(λ [&String] ())
prints a string ref to stdout, does not append a newline.
println
external
(λ [&String] ())
prints a string ref to stdout, appends a newline.
read->EOF
defn
(λ [&String] (Result String String))
(read->EOF filename)
reads a file given by name until the End-Of-File character is reached.
read-file
external
(λ [&String] String)
returns the contents of a file passed as argument as a string.
rewind
external
(λ [(Ptr FILE)] ())
rewinds a file pointer (i.e. puts input and output stream to beginning).
unlink
external
(λ [String] ())
unlinks a file (i.e. deletes it).