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


<masak> so, FIRST doesn't run if there are no iterations.
<jnthn> And nor does LAST any more.
<masak> which phaser do I use if I want to run even when there are no
iterations?
<masak> (I want to do an unconditional once-only take in a 'gather for')
<moritz> INIT?
<masak> moritz: trying.
<masak> m: say (gather for 1..3 { take $_ })
<camelia> rakudo-moar 6dd2e8: OUTPUT«1 2 3␤»
<masak> m: say (gather for 1..3 { INIT take "OH HAI"; take $_ })
<camelia> rakudo-moar 6dd2e8: ( no output )
<masak> o.O
<masak> I...
* masak submits rakudobug
<masak> r: say (gather for 1..3 { INIT take "OH HAI"; take $_ })
<camelia> rakudo-{jvm,moar} 6dd2e8: ( no output )
<camelia> ..rakudo-parrot 6dd2e8: OUTPUT«take without gather [...]»
<masak> oh.
<masak> Parrot may actually have a point.

I think outputting nothing in this case (as Moar and JVM do) is a bug.
At the very least the program should output «1 2 3␤», or fail with an
error message similar to Parrot's on all backends.

Reply via email to