mirror of
https://github.com/GayPizzaSpecifications/pork.git
synced 2025-08-03 05:10:55 +00:00
Support if without else.
This commit is contained in:
@ -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
7
examples/if.pork
Normal file
@ -0,0 +1,7 @@
|
||||
check = { value in
|
||||
if value then 50
|
||||
}
|
||||
|
||||
main = { in
|
||||
value = check(100)
|
||||
}
|
@ -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()
|
||||
]
|
||||
}
|
||||
|
Reference in New Issue
Block a user