[stringtemplate-interest] Fail on undefined property
Terence Parr
parrt at cs.usfca.edu
Fri Jul 31 13:13:10 PDT 2009
Yeah, I hear that. On the other hand, we already have syntax for this
<x> is mandatory
<if(x)><x><endif> is not mandatory
verbose, but functionality already exists ;)
T
On Jul 31, 2009, at 1:11 PM, John D. Mitchell wrote:
> On Jul 31, 2009, at 13:02 , Terence Parr wrote:
>> On Jul 31, 2009, at 1:01 PM, John D. Mitchell wrote:
>>> I haven't followed this thread too closely but in terms of
>>> optionality, one trick would be to add syntactic support for
>>> something like:
>>> <x?> or <x!>
>>
>> that could work but I would prefer to have it on the parameter
>> definitions not the usage:
>>
>> mytemplate(firstname, lastname?) ::= "..."
>
> FWIW, I'm more on the side of "at the point of usage" because I
> think having the fact be very explicit is a good thing. I.e., when
> one is reading through the template, having it jump out as different
> behavior is helpful -- having the same looking thing with two
> different behaviors just bothers me, I guess.
>
> Hope this helps,
> John
>
>
More information about the stringtemplate-interest
mailing list