Builtin functions and types

Warning

Builtins are not yet fully implemented.

Special functions

Name

Example

Comment

all()

all([True, False])

Returns true if all items are true.

any()

any([False, False])

Returns true if any item is true.

default()

default(i64)

Returns the default value of given type. Evaluated in compile time.

enumerate()

enumerate([3, -1])

Enumerate given iterable. Only allowed in for loops.

hash()

hash("Hi")

Hash given object.

input()

input("> ")

Print prompt and read input until newline.

print()

print("Hi!")

Prints given data.

range()

range(10)

A range of numbers. Only allowed in for loops.

reversed()

reversed([2, 1])

Yield items in reversed order. Only allowed in for loops.

slice()

slice([1, 3, 2], 1, -1)

A slice. Only allowed in for loops.

str()

str(10)

Printable represenation of given object.

zip()

zip([3, 5], ["a", "g"])

Yield one item from each iterable. Only allowed in for loops.