[stringtemplate-interest] Re : Templates that get another templates as arguments?

Barrie Treloar baerrach at gmail.com
Mon Jun 27 13:30:42 PDT 2011


2011/6/27 Udo Borkowski <Udo.Borkowski at gmx.de>:
> Matthieu is right, the indirect template expression is one way to solve
> this.
> Alternatively you may also use anonymous templates. Therefore you don't even
> need to create an extra template for each "greeting pattern". Here the
> complete example:

[del]
> hello(name)::=<<
> Hello, <pattern>

[del]

> hello(name)::=<<
> Hello, <(processName)(name)>

I know that StringTemplate will lookup the template name through the
call stack, but is that better than explicitly passing the argument in
to the template?


More information about the stringtemplate-interest mailing list