You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@velocity.apache.org by Jason van Zyl <ja...@zenplex.com> on 2002/08/04 23:36:57 UTC
Re: question about loops
On Mon, 2002-08-05 at 17:00, Greg Frohn wrote:
> I've been using velocity for a while now, and for the most part I love
> it. I'm wondering why are there no for/while loops for VTL?
>
> The foreach loop can be a bit limiting...especially since VTL doesn't
> seem to support break or continue.
>
> I'd love for our web developers to be able to do simple things like
> print out the first n elements in a List. I understand that this can be
> done using range operators and get methods, but having
> while/for/break/continue seems to be much cleaner for many tasks.
>
> Just wondering what your thoughts/reasons are for not including them.
We originally cloned Webmacro and it only had a foreach so we only had a
foreach. But we also tried not to make Velocity a scripting language as
we had designers in mind (even though Velocity has been used in
everything from mailing list managers to source generators). People
asked for while/for loops long ago and occasionally ask and really we
were just trying to keep it simple.
> Anyway, congrats and thanks for a great project.
>
> Greg
> gfrohn@reliacast.com
--
jvz.
Jason van Zyl
jason@apache.org
http://tambora.zenplex.org
In short, man creates for himself a new religion of a rational
and technical order to justify his work and to be justified in it.
-- Jacques Ellul, The Technological Society
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>