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


<masak> wow, this is the worst rakudobug I've had in a while.
<masak> m: for 2, 3 -> $n { my $s = "0" x $n ~ "1"; say $s, ": ",
$s.substr(0, 1) ~ "1" ~ $s.substr(2) }
<camelia> rakudo-moar 0bb3ad: OUTPUT«001: 011␤0001: 0100␤»
<masak> just stare at that for a while.
<masak> that last expression with the .substr calls essentially means
"put in a 1 in the second place, but leave everything else intact".
<masak> well, if that is so, where did the final "1" go in "0001"?
* masak submits rakudobug
<masak> p6: for 2, 3 -> $n { my $s = "0" x $n ~ "1"; say $s, ": ",
$s.substr(0, 1) ~ "1" ~ $s.substr(2) }
<camelia> rakudo-parrot 0bb3ad: OUTPUT«001: 011␤0001: 0101␤»
<camelia> ..rakudo-moar 0bb3ad: OUTPUT«001: 011␤0001: 0100␤»
<masak> right.
<masak> since I know a tiny bit about how strings are implemented on
Moar, I predict that the bug will be tracked down in how string
repetitions are handled.
<masak> p6: say ("0" x 3 ~ "1").substr(2)
<camelia> rakudo-moar 0bb3ad: OUTPUT«00␤»
<camelia> ..rakudo-parrot 0bb3ad: OUTPUT«01␤»
<masak> even golfer.

Reply via email to