NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.
All the Perl that's Practical to Extract and Report
Stories, comments, journals, and other submissions on use Perl; are Copyright 1998-2006, their respective owners.
teach for a new trick (Score:1)
The only condition you have left then would be if the list is empty. "for" has to check that anyway (at some point) so you don't really add anything.
I don't really like to have $LOOP_HAS_RUN = True; any time you call the pointy block.
I tried to implement it in javascript and ended up with the following.
window.super_f
Re:teach for a new trick (Score:1)
Your solution works fine when the
FIRSTandLASTdoes not access any lexical variables specific to the loop block.$ain your Perl 6 code at the end is such a variable. Sending$code_firstand$code_lastin as unrelated closures doesn't give those closures access to$a.For a solution that does work for these cases, please re-read the blog post. :)
Reply to This
Parent