Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Use inheritable fallback for Nil
  • Loading branch information
TimToady committed May 9, 2015
1 parent 835d9b2 commit 0b329a9
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions src/core/Nil.pm
Expand Up @@ -15,15 +15,9 @@ my class Nil is Cool { # declared in BOOTSTRAP
method STORE(*@) { die "Attempted to STORE to Nil." }
method push(*@) { die "Attempted to push to Nil." }
method unshift(*@) { die "Attempted to unshift to Nil." }
method FALLBACK(*@) { Nil }
}

Nil.^add_fallback(
-> $, $name { True },
-> $, $name {
anon sub (|) { Nil }
}
);

my class Empty is Nil {
# class Empty is Iterator
method new(*@) { Empty }
Expand Down

0 comments on commit 0b329a9

Please sign in to comment.