[stringtemplate-interest] Is $if()$ needed?

Roman Odaisky roma at qwertty.com
Sun Aug 10 07:59:18 PDT 2008


Greetings,

I wonder whether $if(attr)$ is redundant. Instead of

$if(attr)$
template
$endif$

one can write

$attr:{template}$

which looks cleaner.

The only thing missing is the else part. Perhaps the grammar can be extended, 
for example, this way:

$attr:{if}$
$attr:{if}!{else}$
$attr!{else}$

This also allows to test for more than one attribute:

$[a, b]:{template}$

“If” constructs come from the imperative world. ST doesn’t have “for”, not 
even “foreach”, why should we have “if”?

-- 
WBR
Roman.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2286 bytes
Desc: not available
Url : http://www.antlr.org:8080/pipermail/stringtemplate-interest/attachments/20080810/7f492909/attachment.bin 


More information about the stringtemplate-interest mailing list