[stringtemplate-interest] StringTemplate extensions

Sohail Somani sohail at taggedtype.net
Sun Jan 8 17:49:17 PST 2006


On Sat, 2006-01-07 at 10:36 -0800, Terence Parr wrote:
> 
> > The reverse option is used for pushing parameters on the stack, the
> > repeat option for default initializers of arrays.
> 
> Excellent use-cases! 

Should the controller say "array a to be 0" or
"a[0]=0,a[1]=0,a[2]=0,...". IMHO, they are different things. The former
may require a repeat option, the latter doesn't. I don't think you would
accomplish any more by pushing the loop into the view. My alarm is also
going off :)

One can understand the need for the conciseness of initialize "array a
to be 0", as you can have hardware support for this that would make it
faster. Even in this case, a repeat option would not be required.

However, the use-case for reverse seems to be right on as different
targets may require a simple reversal of the elements.

Opinions?



More information about the stringtemplate-interest mailing list