-
Notifications
You must be signed in to change notification settings - Fork 0
Standard library
Jan Špaček edited this page Apr 13, 2016
·
3 revisions
The standard library defines the basic functions. Spiral programs do not have any built-in variables, so the import of the standard library is virtually necessary. The library is divided into modules, so the programmer can import only the required functionality.
- module std conveniently reexports the most important definitions. Most programs and modules will import this module.
- module std.core defines the core operations, most of which are reexported from module std.
- module std.bool provides some operations on booleans.
- module std.combinator exports frequently used functional combinators.
- module std.math defines numeric functions.
These structures are implemented in the runtime and the modules provide just a convenient Spiral interface.
- module std.array provides mutable variable-sized arrays.
- module std.cons exports functions for working with cons-cells and lists.
- module std.string defines an interface for working with immutable strings.
- module std.tuple provides functions for working with tuples.
- module std.ref defines mutable references.
- module std.sym exports functions for defining and manipulating symbols.
Advanced structures are written in Spiral and provide higher-level abstractions.
- module std.hashmap defines mutable hash tables.
- module std.hash exports hashing functions to be used in conjuction with hash tables.
- module std.map provides persistent ordered finite maps of ordered keys.
- module std.redmap is an alternative implementation of persistent maps.
- module std.set implements persistent ordered sets.
- module std.heap defines persistent heaps.
- module std.io provides a basic interface for accessing files (including the standard input and output streams).
- module std.env gives access to command-line arguments and environment variables.
- module std.test is a minimalistic yet powerful testing library.