Skip to content

Commit

Permalink
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
jnthn committed May 30, 2011
1 parent c704aff commit 7845bc1
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 2 deletions.
1 change: 1 addition & 0 deletions build/Makefile.in
Expand Up @@ -114,6 +114,7 @@ CORE_SOURCES = \
src/CORE.setting/Routine.pm \
src/CORE.setting/Signature.pm \
src/CORE.setting/Sub.pm \
src/CORE.setting/IO.pm \
src/CORE.setting/EXPORTHOW.pm \
src/CORE.setting/you_are_here.pm \

Expand Down
4 changes: 4 additions & 0 deletions src/CORE.setting/IO.pm
@@ -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))
}
6 changes: 6 additions & 0 deletions src/CORE.setting/Int.pm
@@ -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);
}
}
5 changes: 3 additions & 2 deletions src/CORE.setting/Mu.pm
@@ -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) }
}
3 changes: 3 additions & 0 deletions src/CORE.setting/Str.pm
@@ -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 }
}

0 comments on commit 7845bc1

Please sign in to comment.