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


<masak> hm, not sure I can golf this significantly.
<masak> does the following look odd to anyone?
<masak> r: role Filter[$factor] { method next { repeat until $.value %
$factor { say "R$factor, $.value"; callsame } } }; class Stream { has
$.value is rw = 1; method next { say "bottom out $.value"; ++$.value
}; method filter { self but Filter[$.value] } }; .next && say .value
for Stream.new, *.filter ... *
<p6eval> rakudo b3fc32: OUTPUT«(timeout)bottom out 1␤2␤R2, 2␤bottom
out 2␤3␤R3, 3␤R2, 3␤bottom out 3␤R2, 4␤R2, 4␤R2, 4␤R2, 4 [...]
<masak> more specifically, why, after 'bottom out 3', does it never
bottom out again?
<masak> it's a stack of nested roles, it should bottom out all the time.
<masak> the fact that it doesn't feels like a mis-reference somewhere.
<masak> n: role Filter[$factor] { method next { repeat until $.value %
$factor { say "R$factor, $.value"; callsame } } }; class Stream { has
$.value is rw = 1; method next { say "bottom out $.value"; ++$.value
}; method filter { self but Filter[$.value] } }; .next && say .value
for Stream.new, *.filter ... *
<p6eval> niecza v24-18-gaf64300: OUTPUT«(timeout)bottom out 1␤2␤R2,
2␤bottom out 2␤R3, 3␤R2, 3␤bottom out 3␤R2, 4␤bottom out 4␤R5, 5␤R3,
5␤R2, 5␤bottom out 5␤R2, 6␤bottom out 6 [...]
* masak submits rakudobug
<masak> if I find a way to golf the thing, I'll add that to the ticket.

Reply via email to