pork/examples/syntax.pork

35 lines
555 B
Plaintext

main = { in
three = 3
two = 2
calculateSimple = { in
(50 + three) * two
}
calculateComplex = { in
three + two + 50
}
multiply = { a, b in
a * b
}
calculateSimpleResult = calculateSimple()
calculateComplexResult = calculateComplex()
multiplyResult = multiply(50, 50)
list = [10, 20, 30]
trueValue = true
falseValue = false
check = { in
if true then false else true
}
[
calculateSimpleResult,
calculateComplexResult,
multiplyResult,
list,
trueValue,
falseValue,
check()
]
}