Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Put BUILD in Baggy/Setty role, so we can further simplify KeyBag/KeySet
- Loading branch information
Showing
4 changed files
with
4 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,9 +1,5 @@ | ||
| my class KeyBag does Baggy { | ||
|
|
||
| submethod BUILD (:%elems) { | ||
| nqp::bindattr(self, KeyBag, '%!elems', %elems); | ||
| } | ||
|
|
||
| method Bag { Bag.new-fp(nqp::getattr(self, KeyBag, '%!elems').values) } | ||
| method KeyBag { self } | ||
| } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,9 +1,5 @@ | ||
| my class KeySet does Setty { | ||
|
|
||
| submethod BUILD (:%elems) { | ||
| nqp::bindattr(self, KeySet, '%!elems', %elems); | ||
| } | ||
|
|
||
| method Set { Set.new(self.keys) } | ||
| method KeySet { self } | ||
| } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters