Most of the time, we don't need to have a dynamic call sub graph, since the actual function call could be represented statically as it originally was before lambda functions were implemented. Simplifying the graph shape has important performance benefits in terms of both keep the graph smaller (memory, etc) and in avoiding the need to run transactions at runtime (speed) to reshape the graph. Co-authored-by: Samuel Gélineau <gelisam@gmail.com>
26 lines
495 B
Plaintext
26 lines
495 B
Plaintext
-- main.mcl --
|
|
import "second.mcl"
|
|
|
|
include second.xclass
|
|
-- second.mcl --
|
|
import "fmt"
|
|
|
|
class xclass {
|
|
import "os" # we can also use a scoped local import
|
|
|
|
$aaa = if os.is_family_debian() { "bbb" } else { "ccc" }
|
|
|
|
print "${aaa}" {
|
|
msg => "hello",
|
|
}
|
|
}
|
|
-- OUTPUT --
|
|
Edge: const: str("bbb") -> if # a
|
|
Edge: const: str("ccc") -> if # b
|
|
Edge: os.is_family_debian -> if # c
|
|
Vertex: const: str("bbb")
|
|
Vertex: const: str("ccc")
|
|
Vertex: const: str("hello")
|
|
Vertex: if
|
|
Vertex: os.is_family_debian
|