Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Use new "samewith" functionality in (classify|categorize)-list
  • Loading branch information
lizmat committed Aug 7, 2013
1 parent 3ba7f55 commit 93ca160
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions src/core/Hash.pm
Expand Up @@ -133,10 +133,10 @@ my class Hash { # declared in BOOTSTRAP
self;
}
multi method classify-list( %test, *@list ) {
self.classify-list( { %test{$^a} }, @list );
samewith( { %test{$^a} }, @list );
}
multi method classify-list( @test, *@list ) {
self.classify-list( { @test[$^a] }, @list );
samewith( { @test[$^a] }, @list );
}

proto method categorize-list(|) { * }
Expand Down Expand Up @@ -171,10 +171,10 @@ my class Hash { # declared in BOOTSTRAP
self;
}
multi method categorize-list( %test, *@list ) {
self.categorize-list( { %test{$^a} }, @list );
samewith( { %test{$^a} }, @list );
}
multi method categorize-list( @test, *@list ) {
self.categorize-list( { @test[$^a] }, @list );
samewith( { @test[$^a] }, @list );
}

# push a value onto a hash slot, constructing an array if necessary
Expand Down
8 changes: 4 additions & 4 deletions src/core/KeyBag.pm
Expand Up @@ -112,10 +112,10 @@ my class KeyBag does Associative does Baggy {
self;
}
multi method classify-list( %test, *@list ) {
self.classify-list( { %test{$^a} }, @list );
samewith( { %test{$^a} }, @list );
}
multi method classify-list( @test, *@list ) {
self.classify-list( { @test[$^a] }, @list );
samewith( { @test[$^a] }, @list );
}

proto method categorize-list(|) { * }
Expand Down Expand Up @@ -146,10 +146,10 @@ my class KeyBag does Associative does Baggy {
self;
}
multi method categorize-list( %test, *@list ) {
self.categorize-list( { %test{$^a} }, @list );
samewith( { %test{$^a} }, @list );
}
multi method categorize-list( @test, *@list ) {
self.categorize-list( { @test[$^a] }, @list );
samewith( { @test[$^a] }, @list );
}
}

Expand Down

0 comments on commit 93ca160

Please sign in to comment.