Skip to content

Commit

Permalink
Remove methods from SAFE.setting that conflict with Kernel
Browse files Browse the repository at this point in the history
  • Loading branch information
sorear committed Feb 19, 2011
1 parent f565da2 commit 079b5d7
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions lib/SAFE.setting
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ my class Mu {
}
method succ() { defined(self) ?? die("cannot increment a value of type $.typename") !! 1 }
method pred() { defined(self) ?? die("cannot decrement a value of type $.typename") !! -1 }
method notdef() { !self.defined }
method notdef() { !defined(self) }
method ACCEPTS(\$x) { defined(self) ?? self === $x !! $x.^does(self) }
method perl() { defined(self) ?? self.Str !! self.typename }
method so() { ?self }
Expand Down Expand Up @@ -179,15 +179,8 @@ my class Capture {
# }}}
# Scalar types {{{
my class Num is Cool {
method Str () { Q:CgOp {
(box Str (num_to_string (unbox num (@ {self}))))
} }
method Bool() { Q:CgOp {
(box Bool (compare != (double 0) (unbox num (@ {self}))))
} }
method pred() { (self // 0) - 1 }
method succ() { (self // 0) + 1 }
method Numeric() { self }
method ACCEPTS($t) { defined(self) ?? self == $t !! $t.^does(self) }
}

Expand All @@ -203,9 +196,7 @@ sub infix:<**>($num,$power) {
}

my class Str is Cool {
method Str () { self }
method ACCEPTS($t) { defined(self) ?? self eq $t !! $t.^does(self) }
method Bool () { self ne "" }
method chars() { chars(self) }
method say() { Q:CgOp {
(prog [say (unbox str (@ {self}))]
Expand Down Expand Up @@ -241,7 +232,6 @@ my class Bool is EnumType {
method Str() { self ?? "Bool::True" !! "Bool::False" }
method Stringy() { self.key }
method perl() { ~self }
method Bool() { self }
method ACCEPTS($t) { defined(self) ?? self !! $t.^does(self) }
method Numeric() { self ?? 1 !! 0 }
our constant True = Q:CgOp { (box Bool (bool 1)) };
Expand Down

0 comments on commit 079b5d7

Please sign in to comment.