# New Ticket Created by  "Carl Mäsak" 
# Please include the string:  [perl #68356]
# in the subject line of all future correspondence about this issue. 
# <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=68356 >


<masak> rakudo: my $x = bar => [ baz => 42, sloth => 43 ]; my $y =
:bar[ baz => 42, sloth => 43 ]; say .kv.perl for $x, $y
<p6eval> rakudo 61f269: OUTPUT«["bar", ["baz" => 42, "sloth" =>
43]]␤["bar", baz" => 42, "sloth" => 43]␤»
<masak> is this a bug? if so, is it new?
<moritz_> .kv changed recently
<moritz_> today, that is
<masak> it got ported into the setting, no?
<moritz_> yes
<moritz_> so it seems to pick up the one from Any-list.pm
<moritz_> and not the one from Pair
<masak> but surely the spectests would've caught this...
<moritz_> t/spec/S32-array/kv.t still passes.
<masak> then it has too few tests.
<moritz_> rakudo: my $p = foo => 'bar'; say $p.keys
<p6eval> rakudo 61f269: OUTPUT«0␤»
<masak> o_O
<moritz_> rakudo: my $p = foo => 'bar'; say $p.key
<p6eval> rakudo 61f269: OUTPUT«foo␤»
<moritz_> uhm.
<moritz_> masak: do you agree that Pair.keys should return the same as Pair.key?
<masak> yes, but possibly in a List.
<moritz_> rakudo: my $x = bar => [ baz => 42, sloth => 43 ]; my $y =
:bar[ baz => 42, sloth => 43 ]; say .kv.elems for $x, $y
<p6eval> rakudo 61f269: OUTPUT«2␤3␤»
<moritz_> rakudo: my $x = bar => [ baz => 42, sloth => 43 ]; my $y =
:bar[ baz => 42, sloth => 43 ]; say .perl for $x, $y
<p6eval> rakudo 61f269: OUTPUT«"bar" => ["baz" => 42, "sloth" =>
43]␤"bar" => ["baz" => 42, "sloth" => 43]␤»
<moritz_> so they are different under the hood, but return the same
.perl output?
<moritz_> rakudo: my $x = bar => [ baz => 42, sloth => 43 ]; my $y =
:bar[ baz => 42, sloth => 43 ]; say $x eqv $y
<p6eval> rakudo 61f269: OUTPUT«1␤»
<moritz_> rakudo: my $x = bar => [ baz => 42, sloth => 43 ]; my $y =
:bar[ baz => 42, sloth => 43 ]; .WHAT.say for $x, $y
<p6eval> rakudo 61f269: OUTPUT«Pair()␤Pair()␤»
<moritz_> rakudo: my $x = bar => [ baz => 42, sloth => 43 ]; my $y =
:bar[ baz => 42, sloth => 43 ]; say kv($_).perl for $x, $y
<p6eval> rakudo 61f269: OUTPUT«[0, "bar" => ["baz" => 42, "sloth" =>
43]]␤[0, "bar" => ["baz" => 42, "sloth" => 43]]␤»
<moritz_> rakudo: my $x = bar => [ baz => 42, sloth => 43 ]; my $y =
:bar[ baz => 42, sloth => 43 ]; .PARROT.say for $x, $y
<p6eval> rakudo 61f269: OUTPUT«Perl6Pair␤Perl6Pair␤»
<moritz_> hm, calling @.values seemed to be not my brightest idea
<masak> moritz_: I'll submit the bug if you add the test. :)
<moritz_> masak: ok; I've turned it into 8 tests already
<masak> :)
<moritz_> masak: somehow I suspect it's a dispatching bugs wrt colon
pair $x = :a; my $y = a => True; say a($x); say a($y)
<p6eval> rakudo 61f269: OUTPUT«Pair␤Pair␤»
<moritz_> not that easy, it seems :/

Reply via email to