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


<cognominal> stuck anew with the same message; no return in the gather
though.  https://gist.github.com/cognominal/5458754
<moritz> curious, I get "get_attr_str() not implemented in class 'Coroutine'"
<moritz> with cognominal's code
<cognominal> can we use gather in a recursive setting?
<cognominal> r: sub a($n) { gather { take $n; take $n-1 if $n != 0
}};  say a(2);
<camelia> rakudo 37c995: OUTPUT«2 1␤»
<cognominal> This simpler recursion case works
<masak> moritz: I'm getting the same.
<masak> minimizing.
<moritz> cognominal: iirc [Coke] has hit another limitation of
gather/take recentely; if you reuse the same gather/take block, the
first iterator has to be exhausted before the second one is started
<cognominal> arf
<masak> r: sub p(*@l) { gather { if @l == 1 { take @l } else {
@l.shift; for p(@l) -> @p {} } } }; say p 1..4
<camelia> rakudo 37c995: OUTPUT«get_attr_str() not implemented in
class 'Coroutine' [...]
<masak> there we go.
* masak submits rakudobug
<moritz> for p(@l) -> @p
<moritz> 'for' flattens, so if p(@l) returns a list of arrays of
integers, that's what you get
<masak> moritz: yes, I know.
<masak> moritz: the internal error seems to happen before that, though.

Reply via email to