Data types¶
All primitive types in Radon support objective method syntax via dot notation.
Numbers¶
Numbers represent both integers and floating-point values.
Number Methods¶
| Method | Description |
|---|---|
.to_string() |
Convert to string representation |
.abs() |
Get absolute value |
.round(digits=0) |
Round to decimal places |
.floor() |
Round down to nearest integer |
.ceil() |
Round up to nearest integer |
.is_int() |
Check if value is an integer |
.is_float() |
Check if value has decimal part |
.is_even() |
Check if integer is even |
.is_odd() |
Check if integer is odd |
.is_positive() |
Check if value is positive |
.is_negative() |
Check if value is negative |
.is_zero() |
Check if value is zero |
.sqrt() |
Square root |
.pow(exp) |
Raise to power |
.log(base=e) |
Logarithm (natural by default) |
.log10() |
Base-10 logarithm |
.log2() |
Base-2 logarithm |
.exp() |
e raised to this power |
.sin() |
Sine (radians) |
.cos() |
Cosine (radians) |
.tan() |
Tangent (radians) |
.asin() |
Arcsine (returns radians) |
.acos() |
Arccosine (returns radians) |
.atan() |
Arctangent (returns radians) |
.sinh() |
Hyperbolic sine |
.cosh() |
Hyperbolic cosine |
.tanh() |
Hyperbolic tangent |
.to_radians() |
Convert degrees to radians |
.to_degrees() |
Convert radians to degrees |
.sign() |
Return sign (-1, 0, or 1) |
.clamp(min, max) |
Clamp value to range |
.mod(divisor) |
Modulo operation |
.div(divisor) |
Integer division |
Booleans¶
Booleans represent logical true or false values.
Boolean Methods¶
| Method | Description |
|---|---|
.to_string() |
Convert to "true" or "false" |
.to_number() |
Convert to 1 or 0 |
.toggle() |
Return the opposite boolean value |
.and_(other) |
Logical AND with another value |
.or_(other) |
Logical OR with another value |
.xor(other) |
Logical XOR with another value |
.not_() |
Logical NOT (same as toggle) |
.implies(other) |
Logical implication (this -> other) |
.equals(other) |
Check equality with another boolean |
| boolean_methods.rn | |
|---|---|
Strings¶
Strings are immutable sequences of characters.
See Strings for the complete method reference (25+ methods).
Arrays¶
Arrays are ordered, mutable collections of elements.
| arrays.rn | |
|---|---|
See Arrays for the complete method reference (27 methods).
HashMaps¶
HashMaps are collections of key-value pairs with string keys.
| hashmaps.rn | |
|---|---|
HashMap Methods¶
| Method | Description |
|---|---|
.keys() |
Get array of all keys |
.values() |
Get array of all values |
.items() |
Get array of [key, value] pairs |
.get(key, default=null) |
Get value by key (with optional default) |
.set(key, value) |
Set a key-value pair |
.has(key) |
Check if key exists |
.remove(key) |
Remove a key-value pair |
.length() |
Get number of pairs |
.clear() |
Remove all pairs |
.to_string() |
Convert to string representation |
.is_empty() |
Check if hashmap is empty |
.copy() |
Create a shallow copy |
.merge(other) |
Return new hashmap merged with another |
.pop(key, default=null) |
Remove and return value |
.update(other) |
Update with another hashmap in place |
.get_or_set(key, default) |
Get value or set default if missing |
.filter(func) |
Filter pairs by predicate function |
.map_values(func) |
Transform values with function |
Null¶
Null represents the absence of a value.