Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Dummy &say, first couple of useful setting methods. We can now say('H…
…ello, world!').
- Loading branch information
Showing
5 changed files
with
17 additions
and
2 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
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 |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| # XXX Very cheaty, just to get us able to output something. | ||
| sub say(Mu $value) { | ||
| pir::say__vS(pir::repr_unbox_str__SP(pir::descalarref__PP($value).Str)) | ||
| } |
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,2 +1,8 @@ | ||
| my class Int { | ||
| method Int() { self } | ||
|
|
||
| # XXX multi method Str(Int:D $self:) { ... | ||
| method Str() { | ||
| pir::repr_box_str__PSP(pir::repr_unbox_int__IP(self), Str); | ||
| } | ||
| } |
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,4 +1,5 @@ | ||
| my class Mu { | ||
| method yay(Mu $self:) { pir::say("woo, methods") } | ||
| method ni() { pir::say(self) } | ||
| method item() { self } | ||
|
|
||
| method say() { say(self) } | ||
| } |
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,2 +1,5 @@ | ||
| my class Str { | ||
| # XXX Should be multi method Str(Str:D $self:) { ... } so we don't | ||
| # screw up the type object stringification. | ||
| method Str() { self } | ||
| } |