Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
removed *.notdef
(with small corrections from moritz_)
  • Loading branch information
Jimmy Zhuo authored and moritz committed Feb 26, 2011
1 parent 6437553 commit c2403f2
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/Perl6/Grammar.pm
Expand Up @@ -552,7 +552,7 @@ token term:sym<undef> {
[ <?before [ '(' || \h*<sigil><twigil>?\w ] >
<.obs('undef as a verb', 'undefine function or assignment of Nil')>
]?
<.obs('undef as a value', "something more specific:\n\tMu (the \"most undefined\" type object),\n\tan undefined type object such as Int,\n\tNil as an empty list,\n\t*.notdef as a matcher or method,\n\tAny:U as a type constraint\n\tor fail() as a failure return\n\t ")>
<.obs('undef as a value', "something more specific:\n\tMu (the \"most undefined\" type object),\n\tan undefined type object such as Int,\n\tNil as an empty list,\n\t!*.defined as a matcher or method,\n\tAny:U as a type constraint\n\tor fail() as a failure return\n\t ")>
}

token term:sym<new> {
Expand Down
2 changes: 1 addition & 1 deletion src/core/Cool-str.pm
Expand Up @@ -135,7 +135,7 @@ augment class Cool {
$c++;
} else {
my $m = self.index($match-string, $c);
last if $m.notdef; # CHEAT, but the best I can do for now
last unless $m.defined; # CHEAT, but the best I can do for now
take self.substr($c, $m - $c);
take $match-string if $all;
$c = $m + $match-string.chars;
Expand Down
2 changes: 1 addition & 1 deletion src/core/Int.pm
Expand Up @@ -27,7 +27,7 @@ augment class Int does Real {
}

method sign(Int $x:) {
$x.notdef ?? Mu !! $x <=> 0;
$x.defined ?? $x <=> 0 !! Mu;
}

method gcd(Int $x: Int $y) {
Expand Down
4 changes: 3 additions & 1 deletion src/core/Mu.pm
Expand Up @@ -8,7 +8,9 @@ augment class Mu {
self;
}

multi method notdef() { !self.defined; }
multi method notdef() {
die ".notdef is deprecated, please use negated .defined instead";
}

method note() {
note(self);
Expand Down
2 changes: 1 addition & 1 deletion src/core/Parcel.pm
Expand Up @@ -17,7 +17,7 @@ augment class Parcel does Positional {

multi method ACCEPTS($x) {
self.elems == 0
?? $x.notdef || ($x ~~ Positional && $x == 0)
?? !$x.defined || ($x ~~ Positional && $x == 0)
!! self.Seq.ACCEPTS($x)
}
}
3 changes: 1 addition & 2 deletions src/core/Real.pm
Expand Up @@ -71,8 +71,7 @@ role Real does Numeric {
}

method sign(Real $x:) {
$x.notdef ?? Mu
!! ($x ~~ NaN ?? NaN !! $x <=> 0);
$x.defined ?? ($x ~~ NaN ?? NaN !! $x <=> 0) !! Mu;
}

method floor(Real $x:) {
Expand Down

0 comments on commit c2403f2

Please sign in to comment.