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.
18 lines
467 B
Plaintext
18 lines
467 B
Plaintext
-- main.mcl --
|
|
# This sort of thing is not currently supported, and not sure if it ever will.
|
|
|
|
# test generating a function with outside scoping
|
|
$const1 = "hello"
|
|
class funcgen2 {
|
|
func fun2() {
|
|
$const1 + " " + $const2
|
|
}
|
|
}
|
|
$const2 = "world" # added here to confirm any-order rules
|
|
|
|
include funcgen2
|
|
$x2 = fun2() # not funcgen2.fun2 since it's *not* an import!
|
|
test "${x2}" {} # hello world
|
|
-- OUTPUT --
|
|
# err: errSetScope: func `fun2` does not exist in this scope
|