[stringtemplate-interest] "rest" and template recursion

Zenaan Harkness zen at freedbms.net
Fri May 30 23:30:39 PDT 2008

On Fri, May 30, 2008 at 11:05:22PM -0700, Sasha Crosland wrote:
> Thanks for the explanation, Terence.  A side-effect-free rest() does seem
> more in the spirit of StringTemplate, doesn't it?  I vote yes, for what it's
> worth.
> But would you actually need to make a copy of the list data?  If lists are
> immutable within a template, then couldn't you easily return a lightweight
> view of the sublist that reads through to the original list, just like with
> an iterator?

Vote thirded.

Recursion ought to Just Work (TM).

I additionally vote for an addition to first,last,rest to fill the gap,
perhaps "front" (all but last).

Lightweight container wrapper is definitely the go here.
ArrayList.clone(), or Collection.clone() should do what's needed.


Homepage: www.SoulSound.net -- Free Australia: www.UPMART.org
Please respect the confidentiality of this email as sensibly warranted.

More information about the stringtemplate-interest mailing list