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


<Ayiko> r: for ^0 { FIRST say 'first'; LAST say 'last'; LEAVE say
'leave'; } # should this LAST be run?
<p6eval> rakudo 930369: OUTPUT«last␤»
<masak> Ayiko: S04 says "at loop termination time". even an empty loop
could be said to terminate.
<masak> r: for ^0 { my $a = 42; LAST { say $a } }
<p6eval> rakudo 930369: OUTPUT«Any()␤»
<Ayiko> but then FIRST runs at loop initialization time, shouldn't
that run too then?
<Ayiko> I understand there's a logic to it, it just happens to
interfere with my current use case...
<masak> Ayiko: I may be wrong.
<masak> it also says "after any LEAVE", which would indicate that it
is indeed tied to block entry/exit.
<masak> I definitely agree that FIRST and LAST should behave similarly.
* masak submits rakudobug
<skids> well, I wouldn't say "after any LEAVE" ties it that way, but
would tend to agree whichever way they should behave, FIRST/LAST
should be consistent.
<Ayiko> that's what I'd expect too (though I can see a use for a LAST2
that also runs on empty loops :)
<masak> eeew
<masak> just put the bloody code after the loop! :P
<Ayiko> my @result isn't defined there :(

Reply via email to