min includes a small but powerful standard library organized into the following modules:
- Defines the basic language constructs, such as control flow, type conversions, symbol definition and binding, exception handling, etc.
- Defines combinators and stack-shufflers like dip, dup, swap, cons, etc.
- Defines operators for quotations and dictionaries, like map, filter, reduce, etc.
- Provides operators for reading and writing files as well as printing to STDOUT and reading from STDIN.
- Provides operators for accessing file information and properties.
- Provides comparison operators for all min data types and other boolean logic operators.
- Provides operators to perform operations on strings, use regular expressions, interpolation, etc..
- Provides operators to use as basic shell commands, access environment variables, and execute external commands.
- Provides operators to perform simple mathematical operations on integer and floating point numbers.
- Provides a few basic operators to manage dates, times, and timestamps.
- Provides operators to compute hashes (MD5, SHA1, SHA224, SHA256, SHA384, sha512), base64 encoding/decoding, and AES encryption/decryption.
- Provides many mathematical operators and constants such as trigonometric functions, square root, logarithms, etc.
- Provides basic supports for sockets (some features are not supported on Windows systems).
The following notation is used in the signature of all min operators:
Types and Values
- No value.
- A value of any type.
- A boolean value
- An integer value.
- A float value.
- A numeric (integer or float) value.
- A string value.
- A string-like value (string or quoted symbol).
- A quotation (also expressed as parenthesis enclosing other values).
- A dictionary value.
- A timeinfo dictionary:
( (“year” 2017) (“month” 7) (“day” 8) (“weekday” 6) (“yearday” 188) (“hour” 15) (“minute” 16) (“second” 25) (“dst” true) (“timezone” -3600) )
- An error dictionary:
( (“error” “MyError”) (“message” “An error occurred”) (“symbol” “symbol1”) (“filename” “dir1/file1.min”) (“line” 3) (“column” 13) )
- A socket dictionary, created through the
- true (boolean type).
- false (boolean type)
The following suffixes can be placed at the end of a value or type to indicate ordering or quantities.
- The first value of the specified type.
- The second value of the specified type.
- The third value of the specified type.
- The fourth value of the specified type.
- Zero or one.
- Zero or more.
- One or more