-
-
Notifications
You must be signed in to change notification settings - Fork 308
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
examples: lang: Fixup a few examples
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.
- Loading branch information
1 parent
d1753c5
commit e747e12
Showing
2 changed files
with
14 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,19 @@ | ||
$top = "top-level" | ||
class base($s) { | ||
test "middle " + $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 {} | ||
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 {} | ||
test [$top,] {} | ||
test [$b1.middle,] {} | ||
test [$b2.last,] {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters