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


<felher> After i had a problem with a program i golfed down the issue
for quite some time. But i don't get why the two golfed-down
one-liners produce different output:
<felher> nom: my $x; my @a = 1,2; $x = Array.new(@a) => 'x';
$x.key[0]; @a.pop(); say $x;
<p6eval> rakudo bd6742: OUTPUT«[1, 2] => "x"␤»
<felher> nom: my $x; my @a = 1,2; $x = Array.new(@a) => 'x'; @a.pop(); say $x;
<p6eval> rakudo bd6742: OUTPUT«[1] => "x"␤»
<felher> Might this be a bug?
<moritz> the difference is just the $x.key[0]; in sink context, right?
<felher> moritz: yes
<moritz> probably is a bug, yes
<felher> Ah, okay. This was quite funny to debug, since everytime i
added debugging-output everything worked (because i printed it). And
everytime i deleted the print statements for debugging it failed again
:)
<masak> felher++ # nice golf!
<masak> felher: should I submit it?
<felher> masak: sure. Press your "masak submits rakudobug"-Button.
* masak submits rakudobug
<felher> masak: you do have that button, don't you?
* masak smiles mysteriously
< felher> :D
<moritz> nom: my @a = 1,2; my $x = @a => 'x'; @a.pop(); say $x;
<p6eval> rakudo bd6742: OUTPUT«[1] => "x"␤»
<masak> nom: my @a = 1,2; my $x = @a => 'x'; $x.key[0]; @a.pop(); say $x;
<p6eval> rakudo bd6742: OUTPUT«[1] => "x"␤»
<masak> so Array.new is a necessary component of it all.
<masak> so Array.new is a necessary component of it all.
<jnthn> ah
<jnthn> I guess Array.new probably ain't exercised a great deal
<moritz> aye

Reply via email to