Table of Contents
This document tries to provide a complete and up-to-date reference for the syntax and features of the mathshell language.
Commands control the stuff that does not belong within the language itself. Any input starting with a \ (backslash) symbol is treated as a command.
|\bg color||Set the background color of the mathshell. Any valid css color is ok.|
|\clear||Clear all output.|
|\env||List all declared variables.|
|\fg color||Set the font color of the mathshell. Any valid css color is ok.|
|\help||Show help information.|
|\load||Load local mathshell script from file (launches file dialog, chrome only for now).|
|+||Addition. Operands may be numbers, vectors or matrices.|
|-||Subtraction. Operands may be numbers, vectors or matrices.|
|*||Multiplication. Operands may be numbers, or vectors/matrices of suitable sizes under the rules of linear algebra.|
|/||Division. Operands are numbers.|
|//||Division, as above, but output displayed with a horizontal fraction bar.|
|%||Modulo. Operands are numbers|
|^||Exponentiation. Operands are numbers.|
|!||Factorial. Operand is a non-negative integer.|
|<=||Less than or equal to.|
|>=||Greater than or equal to.|
|||||Concatenation. Defined for strings and integers.|
|pi||3.1415926...||Ratio of a circles circumfrence to its diameter.|
The following functions are built into the language and can not be redefined.
The object types Set, RVector, CVector and Matrix are collectively refered to as container structures.
Six types of errors are thrown by mathshell. Five of them will blame you for the mistake, and the last one should never happen.
|Error type||Thrown when ...|
|ParseError||the input is not valid mathshell syntax.|
|ArityError||illegal number of arguments are given to a function.|
|ArgumentError||illegal arguments are given to a function.|
|ComputeError||the computation for some reason was not possible. Like divsion by zero or trying to multiply matrices of incompatible sizes.|
|NotDefinedError||attempt to use an undefined function. If algebraic computation is disabled, it will also be thrown for undefined variables.|
|InternalError||something bad and inconceivable happened within the mathshell core. Please mail me your input.|