Functions
core
Built-in. No import needed.
plus minus times over mod | arithmetic |
eq neq lt gt lte gte | comparison |
and or not | logical |
math
math abs x | absolute value |
math min x y | minimum |
math max x y | maximum |
math floor x | round down |
math ceil x | round up |
math round x | round nearest |
math sqrt x | square root |
math pow x y | power |
math log x | natural log |
math sin x | sine |
math cos x | cosine |
math random | 0 to 1 |
str
str len s | length |
str concat a b | join |
str split s sep | split |
str trim s | whitespace |
str upper s | uppercase |
str lower s | lowercase |
str contains s sub | has substring |
str replace s old new | replace all |
str slice s start end | substring |
list
list len l | length |
list get l i | at index |
list set l i v | set index |
list push l v | append |
list pop l | remove last |
list first l | first element |
list last l | last element |
list slice l start end | sublist |
list reverse l | reverse |
list sort l | sort |
list map l fn | transform |
list filter l fn | keep matching |
list reduce l fn init | fold |
time
time now | unix ms |
time date | ISO string |
time parse s | parse string |
time format t fmt | format |
time year t | get year |
time month t | get month |
time day t | get day |
err
err new msg | create error |
err msg e | get message |
err is x | check if error |
err wrap e msg | add context |
http
http get url | GET |
http post url body | POST |
http put url body | PUT |
http delete url | DELETE |
json
json parse s | parse string |
json string x | to JSON |
json get x path | get field |
json set x path v | set field |
json has x path | field exists |