Files
not-python/examples/expr.not
Alek Ratzloff c6212f5597 Finish up old example that shows off basic expressions and funcalls
The VM now supports the various int comparison methods. An example of a
"pow" method is given to show off recursion, which means we're now
TURING COMPLETE!

Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
2020-11-09 16:50:16 -08:00

16 lines
201 B
Plaintext

pow = fn (n, p) {
if p <= 0 {
return 1
} el {
return n * pow(n, p - 1)
}
}
kilo = pow(2, 10)
mega = pow(2, 20)
giga = pow(2, 30)
println(kilo)
println(mega)
println(giga)