[stringtemplate-interest] static typing
Graham Wideman
gwlist at grahamwideman.com
Thu Jun 18 13:40:30 PDT 2009
Hi Ter:
Some comments:
1. You would be introducing an additional tool and step into the mix: A step in which templates get processed at development time, and other artifacts are produced (so far consisting of a proxy class for each template). If you're going down that path -- ie: development-time munching on the templates -- do you also have in mind other processing that could happen then?
For example, are you considering checking arg types where one template invokes another? Or for that matter, percollating arg types from an invoked templates that declares types, up to an invoker template that does not?
Also, will there need to be more conventions around how the dev-time template muncher finds STGs vs how the user's actual app finds STGs?
2. I'm guessing that if args are declared in ancestor groups or in interfaces (STIs) that descendants/implementers either must declare same-type args, or perhaps are free to not declare arg types, and just inherit the arg types?
3. Are you considering some runtime checking that the proxy classes are in sync with the actual STG file's template args? Ie: so that a warning gets generated on loading the STG, rather than waiting for failure on actually setting the attribs on the specific template, or just wrong template output? (Or is the idea to cover this by unit tests for all templates?)
4. If you're adding types to args, might there also be utility to declaring whether an arg value is required to be set? Sort of like "NOT NULL", except there might be some need to distinguish "the calling program didn't set this attribute" vs "the calling program explicitly set this to empty string" etc.
-- Graham
More information about the stringtemplate-interest
mailing list