Debian Codegraph @

lang/interpret_test/TestAstFunc2/simple-lambda-scope.txtar

raw
1 -- main.mcl --
2 import "fmt"
3
4 # this should be a function as a value, iow a lambda
5 $some_const = 42
6 $answer = func() {
7 $some_const
8 }
9
10 $out = $answer()
11
12 test [fmt.printf("the answer is %d", $out),] {}
13 -- OUTPUT --
14 Vertex: test[the answer is 42]