Files
mgmt/lang/interpret_test/TestAstFunc1/simple-lambda1.txtar
2023-06-01 16:56:44 -04:00

20 lines
471 B
Plaintext

-- main.mcl --
import "fmt"
# this should be a function as a value, iow a lambda
$answer = func() {
"the answer is 42"
}
$out = $answer()
test $out {}
-- OUTPUT --
Edge: call:answer() -> var(out) # var:out
Edge: func() { str("the answer is 42") } -> call:answer() # call:answer
Edge: str("the answer is 42") -> func() { str("the answer is 42") } # body
Vertex: call:answer()
Vertex: func() { str("the answer is 42") }
Vertex: str("the answer is 42")
Vertex: var(out)