Appendix C: Built-in functions
This appendix contains a glossary of Calyxium's built-in functions.
Under Construction
Built-ins Currently in Use
The following is a list of built-ins currently in use, with their functionality described.
panic
- immediately terminates the program and displays the given error messageprint
- prints to the terminalto_float
- converts integers to floatsto_int
- converts floats to integersto_bytes
- converts strings to an array of byteslength
- returns the size of an array or stringinput
- displays the prompt and reads a line of text from standard input, returning it as a unit.assert
- fails if the boolean expression is falsehead
- returns the first element of an arraytail
- returns a new array containing all elements except the firstreverse
- returns a new array with elements in the opposite order
Built-ins Reserved for Future Use
The following built-ins do not yet have any functionality but are reserved by Calyxium for potential future use.
map
- applies a function to each element of an array, returning a new array with the resultsfilter
- returns a new array containing only the elements for which the function returnstrue
fold
- reduces an array to a single value by applying a function cumulatively