[stringtemplate-interest] H2 test a value

Jesper Goertz jesper.goertz at gmail.com
Mon Nov 21 13:27:00 PST 2005


Hi Terence,

StringTemplate is a fine tool, thank you!

In the documentation (of List construction) you write that
"This ability to rearrange attributes is consistent with model-view separation
because the template cannot alter the data structure nor test its values"

However, it seems to be possible to test for specific values by means of
a map attribute with boolean values, e.g., with

map.put("b", Boolean.TRUE);

you can test for the value "b" like in

t(m,n) ::= "$if (!m.(n))$ $n$ $endif$"

When the rest bug has been squashed this can be used to filter out
values from a list and solve "the last empty value problem" in
testEmptyIteratedConditionalValueGetsNoSeparator.

Is this kosher or a vile hack?

Jesper


More information about the stringtemplate-interest mailing list