Skip to content

Basic Functions and Operators

Before going in note that any time VARNAME or FUNCNAME is written, it means a variable or function in the form Collection@Variableor a literal.

call

Syntax:

call FUNCNAME
Calls the function named FUNCNAME.

if

Syntax:

if VARNAME1 == VARNAME2 FUNCNAME
Uses the operator in the middle to compare VARNAME1 and VARNAME2, and if the result is true, calls FUNCNAME. Operators include: ==, !=, <, >, <=, >=.

print

Syntax:

print(VARNAME)

Prints the value of VARNAME to the console.

input

Syntax:

VARNAME1 = input(VARNAME2)

Gets user input from the console with prompt VARNAME2 and stores the result in VARNAME1.

timeit

Syntax:

timeit FUNCNAME
Measures the time taken to execute FUNCNAME and prints the result to the console.

loop

Syntax:

loop VARNAME1 VARNAME2 FUNCNAME

Loops from VARNAME1 to VARNAME2 (end value exclusive) and calls FUNCNAME in each iteration.

until_break

Syntax:

until_break FUNCNAME

Loops until breaking and calls FUNCNAME in each iteration.

break

Syntax:

break

Exits the current loop immediately.

Variable Cloning

Syntax:

VARNAME1 <- VARNAME2

Clones the value of VARNAME2 into VARNAME1. This used when needing to temporarily store a value before modifying it, such as with a counter.

exec

Syntax:

exec VARNAME

Executes the commandline command in the string VARNAME.

Types

Syntax:

1
2
3
4
5
6
NUM num: 1.0
STR str: "Hello, World!"
BOOL bool: true
ARR arr: [1, 2, 3]
LAMBDA l: |print(?@str)|
(_) unknown: ""

All variables are typed, if the type (_) is used the type is inferred, otherwise its explicit.

wait

Syntax:

wait(VARNAME)

Pauses execution for the number of seconds specified in VARNAME.

Shorthand Operator

Syntax:

?@VARNAME = 1+1

The shorthand ? is used for the current collection instead of writing out the full name.

free

Syntax:

free(VARNAME)

Frees the variable VARNAME from memory, allowing it to be reused. This is useful for either managing memory or making variables mutable.