Language
Types
Every binding announces its type on the define line.
Alana likes introductions.
| Type | Meaning | Literal |
|---|---|---|
num | Integer. Whole, unbothered. | 25 |
decimal | A number with a dot, for drama | 12.5 |
str | String. Words in double quotes. | "Hello" |
schar | One character. One. I mean it. | 'A' |
boolean | true or false. No “maybe”. | true |
any | Any type. When you refuse to commit. | true · "Hello" · 23 |
[] | An array of a type | [10, 20] |
Array types
Element type, then brackets. num[], str[], decimal[]. A little queue of values, waiting their turn.
define num[] numbers is [10, 20, 30]; define str[] names is ["Ahsoka", "Yoda", "Kenobi"]; define num[] history is [];
Literals
- Strings wear double quotes.
- Characters wear single quotes. They are smaller. They know.
- Decimals use a dot:
3.3,50.0.
Class types
A class name is a type too.
define Person jacob is newobj Person("Jacob", 21);
— the wardrobe grew.
Details live under
classes.
Conversion
You do not cast by shouting a type name at a value.
You ask nicely via
type parsing
(parsenum, tryparsenum, and their sisters).