Hey,
I'd like to make a little survey: How acceptable would it be to change
text/template so that it can be "locked", that is, to disallow adding
new templates to a set at some point -- after first execution, for
example?
This is what html/template does, because the contextual escaping
mechanism can't accept changes in the parse tree. Right. I'd like to
move the lock to text/template, so that we have some guarantees to
implement inlining and new features. Long term wise it could greatly
reduce the duplicated code in (html|text)/template and simplify other
things.
The most immediate goal for this change would be to:
* Implement a django-like inheritance mechanism, as discussed in
https://groups.google.com/forum/#!topic/golang-nuts/sa7pqTHI_TU/discussion
But there are some clear benefits in the long-term:
* If we inline all {{template}} calls we would greatly simplify the
contextual escaping mechanism from html/template.
* That would reduce duplicated code in (html|text)/template (they
could practically share execution).
* The engine would be more future-proof and ready for optimizations.
New features can be implemented in text/template only, which takes
care of inlining and reducing the vocabulary to what is recognized by,
say, html/template.
So, what would be a big NO to this idea?
-- rodrigo