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>
27 lines
526 B
Plaintext
27 lines
526 B
Plaintext
-- main.mcl --
|
|
import "second.mcl"
|
|
|
|
include second.xclass
|
|
-- second.mcl --
|
|
import "os"
|
|
import "fmt"
|
|
|
|
class xclass {
|
|
#import "os" # this should not be required, top-level should be enough
|
|
|
|
$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
|