assert
assert(cond) / assert(cond, msg)Error if condition is false
Global builtins available in every Ion program without `use`.
assertassert(cond) / assert(cond, msg)Error if condition is false
assert_eqassert_eq(a, b) / assert_eq(a, b, msg)Error if values are not equal
bytesbytes() / bytes(list) / bytes(string) / bytes(n)Create bytes
bytes_from_hexbytes_from_hex(string)Bytes from hex string
cellcell(value)Create a mutable reference cell for shared closure state
channelchannel(buffer_size)Create a buffered channel (tx, rx)
enumerateenumerate(list)List of (index, value) tuples
floatfloat(x)Convert to float
intint(x)Convert to int
lenlen(x)Length of list, string, dict, or bytes
rangerange(n) / range(start, end)Create a range [0..n) or [start..end)
setset() / set(list)Create a set from a list (deduplicates elements)
sleepsleep(ms)Sleep for given milliseconds (requires concurrency feature)
strstr(x)Convert to string
timeouttimeout(ms, fn)Run function with time limit, returns Option (Some or None on timeout)
type_oftype_of(x)Returns type name as string