Numbers
42, -3.14, 0
Strings
"hello world"
+ - * / %
+ 1 2 → 3
* (+ 1 2) 3 → 9
% 7 3 → 1
Comparisons
< > <= >= ==
(< 5 10) → 1 (true)
set
set x 10
set pi 3.14159
lambda
lambda x (* x x)
lambda (x y) (+ x y)
if
if (> x 5) "big" "small"
while
while (< i 10) (inc i)
for
for (set i 0) (< i 5) (inc i) (print i)
begin
begin (print "a") (print "b") (print "c")
inc
inc i
dec
dec j
print "hello"
print (+ 1 2)
input
set name (input)
set age (input)
list
list 1 2 3 4 5
set nums (list)
set nums [1 2 3]
set empty []
append
append nums 42
sort
sort nums
length
length nums
get
get nums 0
concat
concat "hello" " " "world"
type
type "hello" → "string"
Syntax
(function arg1 arg2 ...)
(factorial 5)
(lambda x (* x x) 4)
True
1, any non-zero number
False
0