Files
mgmt/lang/interpret_test/TestAstFunc2/complex-example.txtar
2023-10-17 15:32:13 -04:00

24 lines
356 B
Plaintext

-- main.mcl --
import "fmt"
import "iter"
# function expression
$id1 = func($x str) { # definition site
$x
}
$id2 = func($x str) {
$x + $x
}
$generate = func($idn) {
$idn("foo") # 1 call site, 2 calls
}
$foo = iter.map([$id1, $id2,], $generate)
test $foo[0] || "fail" {}
test $foo[1] || "fail" {}
-- OUTPUT --
Vertex: test[foo]
Vertex: test[foofoo]