Files
mgmt/examples/lang/class-include.mcl
James Shubin d0ed004b24 examples: lang: Test that each of the mcl examples compiles
We let these rot, so fixup the issues and test them!
2024-07-31 17:29:42 -04:00

25 lines
425 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