[stringtemplate-interest] no such attribute error?

Steven Vaccarella st at vac.name
Wed Dec 2 00:30:01 PST 2009


> For migrating to STv4, it would be a big burden to force people to add arg
> lists (the name of template is easy) to each template file.
>
> I don't like that distinction though and so I'm leaning towards forcing
> accurate arg lists.

How about some lenient transitional behaviour to ease migration. You could
introduce an alternative syntax to say that a particular template isn't
declaring formal args, eg:

foo ::= "<y>"

or

foo(...) ::= "<y>"

If the current template or any enclosing template uses this declaration
then ST won't complain about missing args.

Then people can upgrade their templates one at a time to use formal
arguments, starting with the "outermost" ones, and they'll get errors only
in the templates that they've upgraded.

You could immediately deprecate the no-formal-args syntax and output
annoying warning messages to discourage its use in new templates.

Steve



More information about the stringtemplate-interest mailing list