Permalink
Browse files

Make .of work on scalar values

  • Loading branch information...
1 parent 42758c1 commit 26f33e2e4afc8c1305a6f7784300da9bd9302782 @lizmat lizmat committed Aug 8, 2013
Showing with 8 additions and 0 deletions.
  1. +4 −0 src/core/Mu.pm
  2. +4 −0 src/core/Scalar.pm
View
@@ -329,6 +329,10 @@ my class Mu {
multi method gist(Mu:U:) { '(' ~ self.HOW.name(self) ~ ')' }
multi method gist(Mu:D:) { self.perl }
+ proto method of(|) { * }
+ multi method of(Mu:U:) { '(' ~ self.HOW.name(self) ~ ')' }
+ multi method of(Mu:D:) { self.VAR.WHAT.of }
+
proto method perl(|) { * }
multi method perl(Mu:U:) { self.HOW.name(self) }
multi method perl(Mu:D:) {
View
@@ -4,4 +4,8 @@ my class Scalar {
my $d := $!descriptor;
nqp::isnull($d) ?? Str !! $d.name()
}
+ method of() {
+ my $d := $!descriptor;
+ nqp::isnull($d) ?? Mu !! $d.of;
+ }
}

0 comments on commit 26f33e2

Please sign in to comment.