Variables are how FiM++ manages data in memory. There are three primitive data types, as well as arrays and custom objects.
Variables are FiM++'s way of interacting with data in memory.
Types[]
There are three basic types of variables:
- Boolean values represent exactly one of two possible values, such as "true/false", "yes/no", "on/off", "1/0", et cetera. They are stored in memory as a single bit.
- numbers represent 64 bits of data, in IEEE 754 standard double-precision floating-point format. More information on this format can be found on Wikipedia
- characters represent UTF-8 data. Depending on the individual character, this can take up between 8 and 32 bits, inclusive. More information on this format can be found on Wikipedia
Declaration[]
Data Types[]
The following are all the primitive data types in FiM++:
- Numbers
- Numbers are 64-bit (double-precision) floating point data types
- Characters
- Characters are UTF-8 (up to 8 integer bytes) characters
- Boolean values
- Boolean values are 1-bit binary values
An array can be made of any variable using special keywords (usually, appending "s" or "es" onto a preexisting variable type keyword)
Names[]
Each variable name has the following restrictions:
- Must not contain any reserved phrases
- However, literals are okay. Don't forget that this language is case-sensitive, so "
Twilight's number
" is bad, but "Twilight's Number
" is good.
- However, literals are okay. Don't forget that this language is case-sensitive, so "
- Must not contain any punctuation
- Must begin with one non-whitespace, non-literal character
- Must end with one non-whitespace character
Each variable name also has the following freedoms:
- There is no hard limit on the length
- May have any whitespace character in them (yes, even new lines)
- May contain literals, as long as they are not at the beginning of the name
- for instance,
cloud 9
is okay, but not2 princesses
- for instance,
- May contain apostrophes
- Encoded in UTF-8
See Also[]
Phrases (list) | |||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|