+ a b
: sumsa
andb
- a b
: subtractsb
froma
* a b
: multipliesa
byb
/ a b
: dividesa
byb
// a b
: integer division ofa
andb
^ a b
:a
to the power ofb
> a b
:a
greater thanb
< a b
:a
less thanb
>= a b
:a
greater or equals tob
<= a b
:a
less or equals tob
max a b
: maximum ofa
andb
min a b
: minimum ofa
andb
mod a b
: integer division remainder ofa
divided byb
brt a b
:b
-th root ofa
== a b
:a
equals tob
!= a b
:a
not equals tob
& a b
: logic and ofa
andb
| a b
: logic or ofa
andb
readln
: reads a line from the terminalformat elems
: takes a value and turns it into a string, if an array is passed, apply to each element and concatenate the resultsprint elems
: similar to format, but prints the resulting string instead of returning itprintln elems
: similar to print, but prints a linefeed at the endparse-float text
: takes a stringtext
and turns it into a float if possible (may crash)parse-int text
: takes a stringtext
and turns it into an int if possible (may crash)concat init end
: concatenates the two vectors puttingend
at the end ofinit
append elem array
: returns a new array by puttingelem
at the start ofarray
prepend elem array
: returns a new array by puttingelem
at the end ofarray
nth n array
: returns then
-th element ofarray
(the first element is the 0-th)map f array
: takes a functionf
andarray
and return a new array where each element correspond the an element of the source array with thef
appliedreduce f init array
: takes a functionf
, an initial valueinit
andarray
, execute the function withinit
and the first element, then the result with the second, and so on until the end, returns the final resultscan f init array
: similar to reduce but returns an array of each applicationassert ...
: (macro) takes an infinite amount of values and crashes the program if some value is falsyif cond truth fake
: (macro) takes three forms, ifcond
evaluates to a truthy value,truth
is evaluated and its result is returned, otherwise we evaluatefake
and return its result|>
: (macro) takes an infinite amount of forms, evaluate the first, pass it as the argument of the next form, and so on until the last form, returns the result of the last evaluationpi
: 3.1415926 pi constant