If we had a single list wrapped in an interpolated string, it could sneak through type unification, which is not correct. Wrapping a variable by interpolation in a string, must force it to be a string.
17 lines
409 B
Plaintext
17 lines
409 B
Plaintext
-- main.mcl --
|
|
$name = ["a", "bb", "ccc",]
|
|
test $name {}
|
|
test "test" {}
|
|
|
|
Test["test"] -> Test[$name] # must pass
|
|
#Test["test"] -> Test["${name}"] # must fail
|
|
|
|
-- OUTPUT --
|
|
Edge: test[test] -> test[a] # test[test] -> test[a]
|
|
Edge: test[test] -> test[bb] # test[test] -> test[bb]
|
|
Edge: test[test] -> test[ccc] # test[test] -> test[ccc]
|
|
Vertex: test[a]
|
|
Vertex: test[bb]
|
|
Vertex: test[ccc]
|
|
Vertex: test[test]
|