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

Terence Parr parrt at cs.usfca.edu
Mon Aug 18 12:42:51 PDT 2008


On Aug 16, 2008, at 1:39 AM, Roman Odaisky wrote:

> Greetings,
>
>> $attr:{template}$
>> The only thing missing is the else part.
>
> Indeed even this is present, as I’ve just realized:
>
> $if(attr)$template1$else$template2$endif$
>
> $attr:{template1};null={template2}$

wow. cool.

> So $if$ is only syntactic sugar for large templates to avoid  
> building fences
> of braces.

Yeah, and elseif is nice
Ter


More information about the stringtemplate-interest mailing list