Files
mgmt/examples/lang/class-include.mcl
2020-02-01 16:48:23 -05:00

25 lines
422 B
Plaintext

import "fmt"
class foo {
print "foo1" {
msg => "inside foo",
Meta:autogroup => false,
}
}
$wow = "this is wow" # gets captured
class bar($a, $b) { # a parameterized class
print "bar-"+ $a {
msg => fmt.printf("inside bar: %s", $b + "; " + $wow),
Meta:autogroup => false,
}
}
include foo
include foo # duplicate
include bar("b1", "hello")
include bar("b2", "world")
include bar("b2", "world") # duplicate