[stringtemplate-interest] Fail on undefined property
John D. Mitchell
jdmitchell at gmail.com
Fri Jul 31 13:11:45 PDT 2009
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