[stringtemplate-interest] String manipulations

Kay Roepke kroepke at classdump.org
Thu Sep 28 19:52:04 PDT 2006


On 29. Sep 2006, at 4:24 Uhr, Zenaan Harkness wrote:

> How about these:
>
> /* add separator after each name: */
> $names:separator=","$
>
> /* add separator after all but last name: */
> $names;separator=","$

No, please not. It actually took me way too long to see the  
difference...besides, I think it's not nice from a language
points of view. It gives ':' different meanings. Currently it means  
'apply template' while ';' is for separation of options
for template rendering. We should keep that simple, IMHO.
I like the format="" syntax, but not the : vs ; thingy.

I'd expect a formatter to be called with each item in turn, rather  
than to be applied once for the entire string.
This would imply doing formatting first and then inserting the  
separator, I think.

cheers,
-k





More information about the stringtemplate-interest mailing list