Support if without else.

This commit is contained in:
2023-08-19 20:59:14 -07:00
parent cccea9c2ca
commit 903f730d51
8 changed files with 35 additions and 10 deletions

View File

@ -5,4 +5,5 @@ fib = { n in
then 1
else fib(n - 1) + fib(n - 2)
}
main = { in fib(20) }

7
examples/if.pork Normal file
View File

@ -0,0 +1,7 @@
check = { value in
if value then 50
}
main = { in
value = check(100)
}

View File

@ -18,12 +18,17 @@ main = { in
trueValue = true
falseValue = false
check = { in
if true then false else true
}
[
calculateSimpleResult,
calculateComplexResult,
multiplyResult,
list,
trueValue,
falseValue
falseValue,
check()
]
}