| 1 |
-- main.mcl -- |
| 2 |
# reported by foxxx0 |
| 3 |
import "classes.mcl" as baz |
| 4 |
include baz.foo("hello world") |
| 5 |
include baz.foo("meep") |
| 6 |
include baz.foo("foo") |
| 7 |
-- classes.mcl -- |
| 8 |
import "datetime" |
| 9 |
import "math" |
| 10 |
|
| 11 |
class foo($bar) { |
| 12 |
$now = datetime.now() |
| 13 |
print "/tmp/some-module-${bar}" { |
| 14 |
msg => if datetime.weekday($now) == "friday" { "TGIF YAY!" } else { "meh..." }, |
| 15 |
} |
| 16 |
$x = math.mod($now, 2) |
| 17 |
print "/tmp/some-module-${bar}-flipflop" { |
| 18 |
msg => if $x == 0 { "FLIP" } else { "FLOP" }, |
| 19 |
} |
| 20 |
} |
| 21 |
-- OUTPUT -- |
| 22 |
Vertex: print[/tmp/some-module-foo-flipflop] |
| 23 |
Vertex: print[/tmp/some-module-foo] |
| 24 |
Vertex: print[/tmp/some-module-hello world-flipflop] |
| 25 |
Vertex: print[/tmp/some-module-hello world] |
| 26 |
Vertex: print[/tmp/some-module-meep-flipflop] |
| 27 |
Vertex: print[/tmp/some-module-meep] |