From 09a9bbc0ddac8de5c7ab00af795a9f6f56560d3e Mon Sep 17 00:00:00 2001 From: Elizabeth Mattijsen Date: Sun, 10 Jun 2018 11:20:34 +0200 Subject: [PATCH] Privatize Quanthash hashification --- src/core/Baggy.pm6 | 6 +++--- src/core/Mixy.pm6 | 4 ++-- src/core/Setty.pm6 | 6 +++--- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/core/Baggy.pm6 b/src/core/Baggy.pm6 index 501d600a80b..8b53d63eec7 100644 --- a/src/core/Baggy.pm6 +++ b/src/core/Baggy.pm6 @@ -262,7 +262,7 @@ my role Baggy does QuantHash { nqp::p6bool($!elems && nqp::elems($!elems)) } - method HASHIFY(\type) { + method !HASHIFY(\type) { nqp::stmts( (my $hash := Hash.^parameterize(type,Any).new), (my $descriptor := nqp::getattr($hash,Hash,'$!descriptor')), @@ -291,8 +291,8 @@ my role Baggy does QuantHash { $hash ) } - multi method hash(Baggy:D: --> Hash:D) { self.HASHIFY(Any) } - multi method Hash(Baggy:D: --> Hash:D) { self.HASHIFY(UInt) } + multi method hash(Baggy:D: --> Hash:D) { self!HASHIFY(Any) } + multi method Hash(Baggy:D: --> Hash:D) { self!HASHIFY(UInt) } method default(Baggy:D: --> 0) { } diff --git a/src/core/Mixy.pm6 b/src/core/Mixy.pm6 index 224ac47a796..52d719dc338 100644 --- a/src/core/Mixy.pm6 +++ b/src/core/Mixy.pm6 @@ -1,7 +1,7 @@ my role Mixy does Baggy { - multi method hash(Mixy:D: --> Hash:D) { self.HASHIFY(Any) } - multi method Hash(Mixy:D: --> Hash:D) { self.HASHIFY(Real) } + multi method hash(Mixy:D: --> Hash:D) { self!HASHIFY(Any) } + multi method Hash(Mixy:D: --> Hash:D) { self!HASHIFY(Real) } multi method kxxv(Mixy:D:) { Failure.new(".kxxv is not supported on a {self.^name}") diff --git a/src/core/Setty.pm6 b/src/core/Setty.pm6 index 4908e56dc05..1dfbb4f0b3d 100644 --- a/src/core/Setty.pm6 +++ b/src/core/Setty.pm6 @@ -74,7 +74,7 @@ my role Setty does QuantHash { nqp::p6bool($!elems && nqp::elems($!elems)) } - method HASHIFY(\type) { + method !HASHIFY(\type) { nqp::stmts( (my $hash := Hash.^parameterize(type,Any).new), (my $descriptor := nqp::getattr($hash,Hash,'$!descriptor')), @@ -100,8 +100,8 @@ my role Setty does QuantHash { $hash ) } - multi method hash(Setty:D: --> Hash:D) { self.HASHIFY(Any) } - multi method Hash(Setty:D: --> Hash:D) { self.HASHIFY(Bool) } + multi method hash(Setty:D: --> Hash:D) { self!HASHIFY(Any) } + multi method Hash(Setty:D: --> Hash:D) { self!HASHIFY(Bool) } multi method ACCEPTS(Setty:U: \other) { other.^does(self) } multi method ACCEPTS(Setty:D: Setty:D \other) {