Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Quick version of .shift which seems to work, and a very mysteriously …
…broken shift proto.
  • Loading branch information
colomon committed Dec 9, 2009
1 parent e1fcd3c commit 607a650
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/core/Array.pm
Expand Up @@ -27,9 +27,16 @@ augment class Array {
self;
}

#CHEAT: Should return fail rather than Mu
our multi method pop() {
self.elems > 0 ?? pir::pop__PP($!values) !! Mu;
}

#CHEAT: Should return fail rather than Mu
our multi method shift() {
self.elems > 0 ?? pir::shift__PP($!values) !! Mu;
}
}

our proto sub pop(@array) { @array.pop; }
our proto sub shift(@array) { @array.shift; }

0 comments on commit 607a650

Please sign in to comment.