This page provides a reference for the Tetra standard library. The library is currently quite small. Future versions of Tetra will expand the standard library.

`print(*)`

This function takes any number of arguments and prints them to the screen. The arguments are printed one after the other without any white space automatically inserted.`str(*) string`

This function takes any number of arguments and returns them as a string. It uses the same format as the`print`

function, except that it returns the result as a string instead of printing to the screen.`input() string`

This function reads a string from the user of the program. It does not return until the user has entered input.`input(prompt string) string`

This version of the input function takes a prompt string as an argument. The prompt will be printed to the screen before waiting for the users input.

`PI`

This constant has an approximation of the value of PI.`sqrt(value real) real`

This function returns the square root of its argument.`sin(value real) real`

This function returns the sine of its argument, an angle measured in degrees.`cos(value real) real`

This function returns the cosine of its argument, an angle measured in degrees.`tan(value real) real`

This function returns the tangent of its argument, an angle measured in degrees.`abs(value real) real`

This function returns the absolute value of its argument.

`toInt() int`

This function returns an integer version of the string. If the string has non-digits in it, then it will return the value 0.`toReal() real`

This function returns a real version of the string. If the string does not contain a valid real number, then it will return the value 0.0`toBool() bool`

This function returns a real version of the string. If the string does not equal either "true" or "false", then the function will return false.`length() int`

This function returns the length of the string as an integer.

`length() int`

This function returns the length of the string as an integer.`resize(newSize int)`

This function resizes the list to be larger. If the new size is less than the current size, then elements at the end of the list will be lost. If the new size is larger, then new elements will be added at the end (with default values).

`length() int`

This function returns the length of the string as an integer.`values() [valtype]`

This function returns the values of the dictionary in a list. The return type is a list of the type of values the dictionary is storing.`keys() [keytype]`

This function returns the keys of the dictionary in a list. The return type is a list of the type of keys the dictionary is storing.

Copyright © 2018 Tetra | Licensed under the MIT License