velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jason van Zyl <>
Subject Re: question about loops
Date Sun, 04 Aug 2002 21:36:57 GMT
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

Jason van Zyl

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:   <>
For additional commands, e-mail: <>

View raw message