[stringtemplate-interest] How to write a helper template/macro for common stuff in a template (i.e. model and controller independent)

Barrie Treloar baerrach at gmail.com
Fri Jul 17 18:21:55 PDT 2009


I cant use a Java class because these are model and controller independent.
i.e. they are view helper templates to make writing the view easier.

Its one of the reason I am hoping someone else has a similar use case.
Hoping a different view will increase my understanding.


On Sat, Jul 18, 2009 at 6:48 AM, Terence Parr<parrt at cs.usfca.edu> wrote:
> use a Java class whose toString method returns String.valueOf(counter++).
> Ter
> On Jul 17, 2009, at 1:29 AM, Barrie Treloar wrote:
>
>>> For my case, what I think I want is something like:
>>>  <[1..6]: {RETYPE [<it>] 0}>
>>> where [1..6] creates a list on the fly for me of the values [1,2,3,4,5,6]
>>
>> Thanks for the suggestions, this prompted me to try
>>
>> <[1,2,3,4,5,6]: {RETYPE [<it>] 0<\n>}>
>>
>> which does what I want but not entirely sure its any better than
>> pasting in the lines 6 times.
>
>


More information about the stringtemplate-interest mailing list