In SIMAS, there are five main data types:
-
NUM
- The 'NUM' data type is used to denote a variable containing numbers only.
- Implementations of the 'NUM' data type should be able to handle both Signed Integer and Signed Floating point numbers within the same variable.
- When converted into a BOOL, the resulting boolean should either be "true" (non-zero value) or "false" (must be zero).
-
BOOL
- The 'BOOL' data type can only be "true" or "false". It should not be able to contain any other value.
- When converted into a NUM, it should either produce the value '1' (true) or '0' (false).
- When converted into a STR, it should produce a string literal being either the word "true" or "false".
-
STR
- The 'STR' data type contains strings of any size.
- Implementations of the 'STR' data type should be able to dynamically store and retrieve any size string literal.
- When converted into a NUM, the operation should only be successful if the input contains nothing except a valid signed integer or float.
- When converted into a BOOL, the operation should only be successful if the input is the word "true" or "false" (case insensitive).
-
LIST
- The 'LIST' data type contains an array of variables of any type and value.
- Implementations of the 'LIST' data type should allow dynamic resizing of the list depending on the number of elements within the list, and elements should only be accessible / modifiable using designated "LIST" instructions.
- Lists should not be able to be cast into other data types; lists merely hold different variables.
-
IN
- The 'IN' data type does not store data in itself, but rather denotes user input.
- Implementations of the 'IN' data type should be string literals that are inputted by the user.
All operations involving one or more variables (e.g. list upv) should be able to automatically infer the data type from the variable used.