Types
Primitive types
| Type | Value |
|---|---|
bool | true, false |
int | 32-bit signed integer |
float | 64-bit floating point; always finite |
string | an immutable Unicode string |
time | a minute of the day, 00:00–23:59 |
duration | a signed span of whole minutes |
color | four channels (.r .g .b .a) on a 0–1 scale |
- There is no
noneor null. Object references come in the next version. - Colour channels are not clamped while computing; they are clamped where they reach the screen.
Conversions
The only implicit conversion is int → float. The others are written with as:
| Written | Result |
|---|---|
f as int | truncates toward zero (2.7 → 2, -2.7 → -2) |
x as string | works from every primitive type |
t as int, n as time | the minute of the day; outside 0–1439 is an error |
d as int, n as duration | minutes |
There is no conversion from a string to a number. A failing conversion is a runtime error.
What as string writes: int in decimal, float in its shortest round-trip form, bool as
true/false, time as HH:MM, duration as 1h30m, color as #rrggbbaa.
Equality and comparison
- Equality is exact:
floatwithout tolerance, strings code point by code point, colours channel by channel. <,<=,>,>=are defined on numbers,time,durationand strings.- Comparisons do not chain:
a < b < cis an error.
Arithmetic
+ - * /work on numbers;%onintonly.- Mixing
intandfloatgives afloat. time ± duration → time, wrapping within the day:23:30 + 1h == 00:30.duration ± durationandduration * intare defined.+joins strings; a string does not join another type: use{…}oras string.intoverflow, division by zero, and afloatoperation that gives infinity or NaN are errors (Determinism).