[stringtemplate-interest] accept simple expression language

Terence Parr parrt at cs.usfca.edu
Mon May 11 13:10:48 PDT 2009


Hi. Addition or other computation on model values is forbidden in the  
view to avoid entangling model/view.  You really need to compute in  
the model and pass in some how.  Adding numbers isn't "customization"  
though as you ask about...it's an entanglement to be avoided :)

Ter
On May 10, 2009, at 12:58 PM, DVD wrote:

> Hello:
>
> I experimented with ST and really like use it for all my projects
> replacing freemarker.
> The only thing I feel uncertain is that ST does not provide an option
> to allow using a simple expression langauge for template author for
> customization without
> requiring model developer to provide the needed data. For example,
> if originally the template is like
>
> $O.a$$O.b$
>
> but a user wants to have only value  c = summing a and b,  something  
> like
> $O.a+O.b$
>
> I guess in order to get this, model dev has to add property "c" in   
> O in
> order for author
> to get.   This is a big problem if an application expects authors to
> import their own templates,
> since the authors would have no way to customize it, even for some
> simple operation.
> Renderer might not help so I am not sure if there is any solution for
> this scenario. I went through
> the doc but did not have an example.
>
> Thanks
>
> _______________________________________________
> stringtemplate-interest mailing list
> stringtemplate-interest at antlr.org
> http://www.antlr.org/mailman/listinfo/stringtemplate-interest



More information about the stringtemplate-interest mailing list