Files
pork/examples/syntax.pork

30 lines
489 B
Plaintext
Raw Normal View History

2023-08-19 20:40:31 -07:00
main = { in
2023-08-19 15:29:07 -07:00
three = 3
two = 2
2023-08-19 20:40:31 -07:00
calculateSimple = { in
2023-08-19 15:29:07 -07:00
(50 + three) * two
}
2023-08-19 20:40:31 -07:00
calculateComplex = { in
2023-08-19 15:29:07 -07:00
three + two + 50
}
2023-08-19 20:40:31 -07:00
multiply = { a, b in
a * b
}
2023-08-19 15:29:07 -07:00
calculateSimpleResult = calculateSimple()
calculateComplexResult = calculateComplex()
2023-08-19 20:40:31 -07:00
multiplyResult = multiply(50, 50)
2023-08-19 15:29:07 -07:00
list = [10, 20, 30]
trueValue = true
falseValue = false
[
calculateSimpleResult,
calculateComplexResult,
2023-08-19 20:40:31 -07:00
multiplyResult,
2023-08-19 15:29:07 -07:00
list,
trueValue,
falseValue
]
}