[stringtemplate-interest] sequences and unique numbers
Sam Barnett-Cormack
s.barnett-cormack at lancaster.ac.uk
Fri Aug 7 12:13:24 PDT 2009
Replying to myself again...
Sam Barnett-Cormack wrote:
>
> Continuing my habit of replying to myself... I know that, currently, ST
> formal parameters hide the invoking template's parameters, although the
> caller can override this with <template(...)>. As I was suggesting
> expanding the template parameter definition syntax, it might be nice
> (from a documentation point of view) to specify parameters that *don't*
> hide the caller's values. In face, one thing that would be nice in the
> kind of use-cases I can imagine is a variant of default specification
> that allows you to say "this parameter will have the value it has in the
> caller, unless it's empty (unset) in the caller, in which case it will
> have this default".
An example of the template code I find myself writing because I can't do
this:
<if(extends)>
<classhead()>
<else>
<classhead(extends="ASN1Value")>
<endif>
It'd be much nicer, from my point of view, in my use case, to specify
that in the definition of classhead() instead. Instead, I have to *not*
list classhead as a formal parameter, even though it needs to be set for
the template to work. Now, I could set it this way in the body of
classhead instead, by setting extends as a formal parameter and doing
the same logic as above there. Wherever I do it, it's messy.
Is there a distinction between "blank"/"null" and "unset"?
--
Sam Barnett-Cormack
More information about the stringtemplate-interest
mailing list