Globals

print(...)

Prints all the arguments to stdout transforming them into strings.

input(prefix: string): string

Reads the input from stdin until enter has been pressed and returns it as a string. (the string contents are being trimmed)

assert(cond)

If cond is a false value, an error will be thrown.

error(msg)

Throws an error with the message msg which is stringified first.

exit(code: int?)

Exits the program with the exit code code. (default is 0)

safe_call(f: fn, ...): { ok?, err: string? }

Run's the function in safe manner. Errors will not cause the program to crash, but the error will be returned in form of an object as the field err. If it runs successfully the field ok holds the return value.

range(start: int, end: int?): iterator<int>

Creates an iterator over the given range defined by start and end. If end is null, start will be 0 and end will be the start

type(value): string

definition: typed.type

options(value, ...): bool

definition: typed.options

some(value): bool

definition: typed.some

str(...): string

definition: string.from

keys(o: object): iterator<string>

definition: object.keys

values(o: object<V>): iterator<V>

definition: object.values

setmeta(o: object<V>, meta: object?): object<V>

definition: object.setmeta

getmeta(o: object): object?

definition: object.getmeta