lang_2023/tests/lambdas.lang

13 lines
235 B
Text
Raw Normal View History

2023-06-03 19:01:03 +03:00
decl test-lambdas : -> \unit
def test-lambdas = {
const lambda1 = \\x -> x * x
const lambda2 = \\x -> x..hash:
const lambda3 = \\x y -> x + y
2023-03-31 12:10:12 +03:00
2023-06-03 19:01:03 +03:00
const lambda4 = \\x -> {
; \io..print: x
2023-03-31 12:10:12 +03:00
const y = x + x
return y
}
}