Skip to content
Permalink
Browse files

Give QuantHashes proper .of / keyof methods

So that hyper methods may actually properly recognize them.

Note that properly parameterizing Associative gave rise to all sort of weird
errors during the building of the setting.  Which is why the local overrides.
  • Loading branch information...
lizmat committed Nov 5, 2018
1 parent 7a85985 commit 8b93ec9f50e6309c1808e818d3813d4a30b454f7
Showing with 8 additions and 0 deletions.
  1. +2 −0 src/core/Baggy.pm6
  2. +2 −0 src/core/Mixy.pm6
  3. +2 −0 src/core/QuantHash.pm6
  4. +2 −0 src/core/Setty.pm6
@@ -12,6 +12,8 @@ my role Baggy does QuantHash {
# Immutables aspects of Bag/Mix, need to live to Bag/Mix respectively.

#--- interface methods
method of() { UInt }

multi method ACCEPTS(Baggy:U: \other --> Bool:D) {
other.^does(self)
}
@@ -1,5 +1,7 @@
my role Mixy does Baggy {

method of() { Real }

multi method hash(Mixy:D: --> Hash:D) { self!HASHIFY(Real) }
multi method Hash(Mixy:D: --> Hash:D) { self!HASHIFY(Any) }

@@ -1,5 +1,7 @@
my role QuantHash does Associative {

method keyof() { Any }

method SET-SELF(QuantHash:D: \elems) { # cannot be a private method
nqp::stmts(
nqp::if(
@@ -1,6 +1,8 @@
my role Setty does QuantHash {
has Rakudo::Internals::IterationSet $!elems; # key.WHICH => key

method of() { Bool }

# helper sub to create Set from iterator, check for laziness
sub create-from-iterator(\type, \iterator --> Setty:D) {
nqp::if(

0 comments on commit 8b93ec9

Please sign in to comment.
You can’t perform that action at this time.