> On 14 Jul 2015, at 12:29, Carl Mäsak (via RT) <[email protected]>
> wrote:
>
> # New Ticket Created by "Carl Mäsak"
> # Please include the string: [perl #125614]
> # in the subject line of all future correspondence about this issue.
> # <URL: https://rt.perl.org/Ticket/Display.html?id=125614 >
>
>
> <jnthn> my %h{Mu}; # now you can store objects as keys
> <jnthn> m: my %xy{Mu};
> <camelia> rakudo-moar dd3bcc: ( no output )
> <jnthn> Note the keys there are objects, not strings.
> <moritz> m: my %xy{Mu}; %xy{1&2} = 3; say %xy.perl
> <camelia> rakudo-moar ccb41d: OUTPUT«Hash[Any,Mu].new(1 => 3, 2 => 3)»
> <moritz> bug
> <jnthn> hah...I wonder if the postcircumfix sub is to blame...
> * masak submits rakudobug
Some more tests:
[22:14:53] <lizmat> Looking at #125614 now:
[22:15:02] <lizmat> m: my %xy{Mu}; %xy{1&2} = 3; say %xy.perl # wrong
[22:15:02] <+camelia> rakudo-moar 8957fc: OUTPUT«Hash[Any,Mu].new(1 => 3, 2
=> 3)»
[22:15:25] <lizmat> m: my %xy{Mu}; %xy.AT-KEY(1&2) = 3; say %xy.perl # is
this right?
[22:15:25] <+camelia> rakudo-moar 8957fc: OUTPUT«Hash[Any,Mu].new(all(1 => 3,
2 => 3))»
[22:15:43] <lizmat> m: my %xy{Mu}; %xy.ASSIGN-KEY(1&2,3); say %xy.perl #
is this right?
[22:15:43] <+camelia> rakudo-moar 8957fc: OUTPUT«Hash[Any,Mu].new(all(1 => 3,
2 => 3))»
[22:16:20] <lizmat> m: my %xy{Mu}; %xy.BIND-KEY(1&2,3); say %xy.perl #
and this?
[22:16:21] <+camelia> rakudo-moar 8957fc: OUTPUT«Hash[Any,Mu].new(all(1 => 3,
2 => 3))»
[22:17:53] <ShimmerFairy> Hm. Unless there's something in the specs
stating otherwise, I'd think %xy{1&2} = 3 would make 1 => 3, 2 => 3 , since it
is a Junction
[22:17:53] <lizmat> m: my %xy{Any}; %xy{1&2} = 3; say %xy.perl # and this?
[22:17:53] <+camelia> rakudo-moar 8957fc: OUTPUT«Hash[Any,Any].new(1 => 3, 2
=> 3)»
[22:17:57] <ShimmerFairy> m: sub foo($a) { say $a }; foo(1&2)
[22:17:58] <+camelia> rakudo-moar 8957fc: OUTPUT«12»
[22:18:18] <ShimmerFairy> ^ that's my reason for thinking {1&2} is the
one doing the right thing.
[22:18:58] <lizmat> not if it is a typed hash with Mu: then the
autothreading should not work (is what conception of the problem is)
[22:20:58] <ShimmerFairy> Oh, I see. Well, I think in that case it should
be any(1, 2) => 3 , since the Junction is the key (I don't think all(1 => 3,
2 => 3) is right, and I don't see how it could be immediately)
So, assuming AT-KEY is doing the right thing, and looking at the circumfix {}
code:
multi sub postcircumfix:<{ }>( \SELF, \key ) is rw {
SELF.AT-KEY(key);
}
Since we bind the key value to what is being passed to AT-KEY, and AT-KEY is
doing the right thing, I can only assume there is something screwy going on
with “is rw”. And that is going right into the bowels, and I’m out of my
league :-)
Hope this helps.
Liz