std
The std package holds a few general helpers, mostly function-style versions of built-in methods.
println std::len("kiwi") # 4println std::type([1, 2]) # listprintln std::is_int(3) # trueprintln std::is_float(3) # falseprintln std::is_string("x") # trueprintln std::is_hashmap({}) # trueprintln std::range(1, 5) # [1, 2, 3, 4]std::range(x, y) is end-exclusive, unlike the [x to y] range literal, which includes y.
Most code uses the built-in equivalents directly: .size(), typeof, and .is_a(type).
Functions
Section titled “Functions”std::len
Section titled “std::len”std::len(n)Returns the number of elements or characters in a value.
| Parameter | Type | Default | Description |
|---|---|---|---|
n | any | A string, list, hashmap, or any value with a size() method. |
Returns integer — The size of the value.
std::type
Section titled “std::type”std::type(n)Returns the type name of a value.
| Parameter | Type | Default | Description |
|---|---|---|---|
n | any | Any value. |
Returns string — The type name (e.g., "integer", "string", "list").
std::is_int
Section titled “std::is_int”std::is_int(n)Returns true if the value is an integer.
| Parameter | Type | Default | Description |
|---|---|---|---|
n | any | Any value. |
Returns boolean — true if n is an integer.
std::is_float
Section titled “std::is_float”std::is_float(n)Returns true if the value is a float.
| Parameter | Type | Default | Description |
|---|---|---|---|
n | any | Any value. |
Returns boolean — true if n is a float.
std::is_string
Section titled “std::is_string”std::is_string(s)Returns true if the value is a string.
| Parameter | Type | Default | Description |
|---|---|---|---|
s | any | Any value. |
Returns boolean — true if s is a string.
std::is_hashmap
Section titled “std::is_hashmap”std::is_hashmap(s)Returns true if the value is a hashmap.
| Parameter | Type | Default | Description |
|---|---|---|---|
s | any | Any value. |
Returns boolean — true if s is a hashmap.
std::range
Section titled “std::range”std::range(x, y)Returns an integer range [x, y) as a list.
| Parameter | Type | Default | Description |
|---|---|---|---|
x | integer | The inclusive start of the range. | |
y | integer | The exclusive end of the range. |
Returns list — A list of integers from x to y - 1, or an empty list when y <= x.
Throws InvalidRange — If either argument is not an integer.