xslate / p5-Text-Xslate

Scalable template engine for Perl5
https://metacpan.org/release/Text-Xslate
Other
121 stars 47 forks source link

Loop control statement (LAST, NEXT and REDO) #14

Closed gfx closed 13 years ago

gfx commented 14 years ago

LAST, NEXT and REDO are requested, so they will be added in a future.

jjn1056 commented 14 years ago

I'd personally find these useful. How about having EVEN, ODD, FIRST, END as well :)

gfx commented 14 years ago

Yeah, they are already available in for-loops both in Kolon and TTerse :)

For example: : for $ary -> $iter { : $~iter.is_first; # true if in first : $~iter.lis_ast; # true if in last : $~iter.cycle(true, false); # true -> false -> true -> false ... : } See also http://search.cpan.org/dist/Text-Xslate/lib/Text/Xslate/Syntax/Kolon.pm#Loops

jjn1056 commented 14 years ago

cool!