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.
14 lines
493 B
Plaintext
14 lines
493 B
Plaintext
-- main.mcl --
|
|
import "fmt"
|
|
$format = "%d" # should get ignored
|
|
$fn = func($format) {
|
|
fmt.printf($format, 42)
|
|
}
|
|
$name = $fn("%s")
|
|
test "${name}" {}
|
|
# should error at unification if possible, otherwise at runtime
|
|
# TODO: I would expect that if the "%s" and "%d" swapped, that speculatively we
|
|
# would be able to run this at compile time and know the result statically.
|
|
-- OUTPUT --
|
|
# err: errStream: func `printf@??????????` stopped before it was loaded: base kind does not match (Str != Int)
|