We might change unification to allow naked single strings with fancier unification, but let's leave it as is for now and see how often it comes up.
20 lines
419 B
Plaintext
20 lines
419 B
Plaintext
$top = "top-level"
|
|
class base($s) {
|
|
test ["middle " + $s,] {}
|
|
$middle = "inside base"
|
|
}
|
|
|
|
# syntactic sugar for the equivalent of defining a class `inner` inside of base.
|
|
class base:inner($s) {
|
|
test ["inner " + $s,] {}
|
|
|
|
$last = "i am inner and i can see " + $middle
|
|
}
|
|
|
|
include base("world") as b1
|
|
include b1.inner("hello") as b2 # inner comes out of `base`
|
|
|
|
test [$top,] {}
|
|
test [$b1.middle,] {}
|
|
test [$b2.last,] {}
|