Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Implement .grabpairs where they're *not* supposed to work
  • Loading branch information
lizmat committed Oct 6, 2013
1 parent 2e2f5f0 commit 7b98f86
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/core/Bag.pm
Expand Up @@ -33,6 +33,9 @@ my class Bag does Baggy {
method grab($count = 1 --> Int) is hidden_from_backtrace {
X::Immutable.new( method => 'grab', typename => self.^name ).throw;
}
method grabpairs($count = 1 --> Int) is hidden_from_backtrace {
X::Immutable.new( method => 'grabpairs', typename => self.^name ).throw;
}

method Bag { self }
method BagHash { BagHash.new-fp(nqp::getattr(self, Bag, '%!elems').values) }
Expand Down
3 changes: 3 additions & 0 deletions src/core/Mix.pm
Expand Up @@ -23,6 +23,9 @@ my class Mix does Mixy {
method grab($count = 1 --> Real) is hidden_from_backtrace {
X::Immutable.new( method => 'grab', typename => self.^name ).throw;
}
method grabpairs($count = 1 --> Real) is hidden_from_backtrace {
X::Immutable.new( method => 'grabpairs', typename => self.^name ).throw;
}

method Mix { self }
method MixHash { MixHash.new-fp(nqp::getattr(self, Mix, '%!elems').values) }
Expand Down
3 changes: 3 additions & 0 deletions src/core/Set.pm
Expand Up @@ -24,6 +24,9 @@ my class Set does Setty {
method grab ($count = 1) {
X::Immutable.new( method => 'grab', typename => self.^name ).throw;
}
method grabpairs ($count = 1) {
X::Immutable.new( method => 'grabpairs', typename => self.^name ).throw;
}

method Set { self }
method SetHash { SetHash.new(self.keys) }
Expand Down

0 comments on commit 7b98f86

Please sign in to comment.