[stringtemplate-interest] [ST4 Beta4] Default args are not always evaluated in the context of their template

Terence Parr parrt at cs.usfca.edu
Thu Feb 17 12:55:56 PST 2011


Hi Udo. I'm pretty sure Sam is correct. This is a lazy evaluation issue.  comment inline ####
On Feb 17, 2011, at 3:03 AM, Udo Borkowski wrote:
> -----------
> t1(p1,p2={<p1>}) ::= <<
>  inside t1: p1=<p1>, p2=<p2>
> <t2(p1="B",p2=p2)>
>>
> 
> t2(p1,p2) ::= <<
>  inside t2: p1=<p1>, p2=<p2>    #### <p2> evaluates {<p1>} and p1 has value "B", right?
>>
> 
> main() ::= <<
> Use default value for p2
> <t1(p1="A")>
>>



More information about the stringtemplate-interest mailing list