Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Remove methods from SAFE.setting that conflict with Kernel

  • Loading branch information...
commit 079b5d79bad7426232f82f1b21bb0c6e6422a5fd 1 parent f565da2
@sorear authored
Showing with 1 addition and 11 deletions.
  1. +1 −11 lib/SAFE.setting
View
12 lib/SAFE.setting
@@ -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 }
@@ -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) }
}
@@ -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}))]
@@ -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)) };
Please sign in to comment.
Something went wrong with that request. Please try again.