Here you will find some example krill programs.
(map toNumber . split "-" . date) ()
# => [2019,5,11]
(map toNumber . split ":" . time) ()
# => [17,40]
writeFile "/var/tmp/foo" "hello world"
readFile "/var/tmp/foo"
# => "hello world"
appendFile "/var/tmp/foo" "\nhow are you?"
readFile "/var/tmp/foo"
# => hello world
# => how are you?
fac = n -> {
if n == 0 then 1
else n * (fac $ n - 1)
}
fib = n -> {
if n == 0 then 0
else {
if n == 1 then 1
else fib (n - 1) + fib (n - 2)
}
}
div3 = i -> i % 3 == 0
div5 = i -> i % 5 == 0
div35 = i -> (div3 i) && (div5 i)
for i in [1..100] {
if div35 i then print "FizzBuzz"
else {
if div3 i then print "Fizz"
else {
if div5 i then print "Buzz"
else print i
}
}
}