# 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 12R2, 2bottom
out 23R3, 3R2, 3bottom out 3R2, 4R2, 4R2, 4R2, 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 12R2,
2bottom out 2R3, 3R2, 3bottom out 3R2, 4bottom out 4R5, 5R3,
5R2, 5bottom out 5R2, 6bottom out 6 [...]
* masak submits rakudobug
<masak> if I find a way to golf the thing, I'll add that to the ticket.