This removes the exclusive from the res names and edge names. We now require that the names should be lists of strings, however they can still be single strings if that can be determined statically. Programmers should explicitly wrap their variables in a string by interpolation to force this, or in square brackets to force a list. The former is generally preferable because it generates a small function graph since it doesn't need to build a list.
19 lines
460 B
Plaintext
19 lines
460 B
Plaintext
-- main.mcl --
|
|
import "os"
|
|
$apply1 = func($f, $x) {
|
|
$f($x)
|
|
}
|
|
$apply2 = func($f, $x) {
|
|
$f($f($x))
|
|
}
|
|
$apply = if (os.system("echo 0; echo 1") == "0") {$apply1} else {$apply2}
|
|
$id = func($y) { $y }
|
|
|
|
# since $apply changes over time, this call needs a dynamic sub-graph. In
|
|
# theory, the $f calls above do not need a sub-graph, but does our optimization
|
|
# support this corner case yet?
|
|
$name = $apply($id, "foo")
|
|
test "${name}" {}
|
|
-- OUTPUT --
|
|
Vertex: test[foo]
|