Built-in Functions¶
Ooga Booga provides a small set of built-in functions for common operations. These are always available without any import or declaration — the compiler injects them as Rust helper functions into every generated file.
Type conversion¶
WORDY(x) → WORDS¶
Converts any value to a WORDS (String). Uses Rust's Display trait.
NUMBR(x) → ROCK¶
Parses a WORDS value as a ROCK (i32). Panics with a caveman message if the input is not a valid integer.
Useful after HEAR, which always produces WORDS.
NUMBR_BIG(x) → BIGROCK¶
Parses a WORDS value as a BIGROCK (i64). Use for large integers that overflow ROCK.
NUMBR_DRIP(x) → BIGDRIP¶
Parses a WORDS value as a BIGDRIP (f64).
String¶
BIGNESS(x) → BIGROCK¶
Returns the byte length of a WORDS string as a BIGROCK (i64).
Math¶
FLOORY(x) → BIGDRIP¶
Returns the floor of a BIGDRIP — the largest integer not greater than x.
ROUNDY(x) → BIGDRIP¶
Returns x rounded to the nearest integer (as BIGDRIP).
ROOTY(x) → BIGDRIP¶
Returns the square root of a BIGDRIP.
Summary table¶
| Function | Input type | Output type | Description |
|---|---|---|---|
WORDY(x) |
any | WORDS |
Convert to string |
NUMBR(x) |
WORDS |
ROCK |
Parse as i32 |
NUMBR_BIG(x) |
WORDS |
BIGROCK |
Parse as i64 |
NUMBR_DRIP(x) |
WORDS |
BIGDRIP |
Parse as f64 |
BIGNESS(x) |
WORDS |
BIGROCK |
String byte length |
FLOORY(x) |
BIGDRIP |
BIGDRIP |
Floor |
ROUNDY(x) |
BIGDRIP |
BIGDRIP |
Round to nearest |
ROOTY(x) |
BIGDRIP |
BIGDRIP |
Square root |
Using built-ins in expressions¶
Built-ins are functions and can appear anywhere a function call is valid: