Add function expr parsing

* Introduce new `fn` keyword
* Function example is added to examples/expr.not

Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
This commit is contained in:
2020-09-18 16:39:06 -07:00
parent 337be88849
commit f0032afe12
7 changed files with 95 additions and 9 deletions

View File

@@ -1,7 +1,9 @@
# pow = (n, p) {
# p == 0
# ?? 1
# !! n * pow(n, p - 1)
# pow = fn (n, p) {
# if p == 0 {
# 1
# } else {
# n * pow(n, p - 1)
# }
# }
kilo = pow(2, 10)