Skip to content
Permalink
Browse files

Make Set.WHICH return a ValueObjAt

  • Loading branch information...
lizmat committed Dec 28, 2018
1 parent 4b91610 commit 537621e410c2d9d989d4e39e3980b01f0fed0a5c
Showing with 14 additions and 8 deletions.
  1. +14 −8 src/core/Set.pm6
@@ -1,19 +1,25 @@
my class Set does Setty {
has $!WHICH;
has ValueObjAt $!WHICH;

multi method WHICH (Set:D:) {
multi method WHICH (Set:D: --> ValueObjAt:D) {
nqp::if(
nqp::attrinited(self,Set,'$!WHICH'),
$!WHICH,
$!WHICH := nqp::if(
nqp::istype(self.WHAT,Set),
'Set|',
nqp::concat(self.^name,'|')
) ~ nqp::sha1(
$!WHICH := nqp::box_s(
nqp::concat(
nqp::if(
nqp::eqaddr(self.WHAT,Set),
'Set|',
nqp::concat(nqp::unbox_s(self.^name), '|')
),
nqp::sha1(
nqp::join("\0",Rakudo::Sorting.MERGESORT-str(
Rakudo::QuantHash.RAW-KEYS(self)
))
)
)
),
ValueObjAt
)
)
}

0 comments on commit 537621e

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