[stringtemplate-interest] another tweak

Zenaan Harkness zen at freedbms.net
Sat Jul 11 17:05:49 PDT 2009


On Sat, Jul 11, 2009 at 01:13:10PM -0700, Terence Parr wrote:
> changes for today:
> 
> 07-11-2009
> 
> o If default arg is a template with single expression wrapped in  
> parens, x={<(...)>},
>    then eval to string rather than setting x to the template for later  
> eval. Useful
>    in rare cases where the expression can change value when you read  
> it, such as
>    accessing time value or random number generator object.

That's cool. The benefits of writing a book - you find real-world usage
scenarios that require re-thinks/ features.


> o Added line break operator <\\>. It consumes remaining whitespace on  
> that line, the first and then any whitespace.
> Added a number of unit tests. example:
> 
>    "foo <\\>
>         bar"
> 
>    emits "foo bar". All of the whitespace after the <\\> gets thrown  
> away like a comment.

Ahh, so this is a white space consumption operator, not a "line break"
operator.

Line break would mean insert line break (not very useful in a template,
just insert a line break), at least by the common understanding of the
term.

cheers
zen

-- 
Homepage: www.SoulSound.net -- Free Australia: www.UPMART.org
Please respect the confidentiality of this email as sensibly warranted.


More information about the stringtemplate-interest mailing list