[stringtemplate-interest] Dynamic binding of templates?
Sam Barnett-Cormack
s.barnett-cormack at lancaster.ac.uk
Sun Jun 5 05:12:12 PDT 2011
On 05/06/2011 12:55, Sam Barnett-Cormack wrote:
> I want the extension templates to actually be satisfying some abstract
> interface and be called by the core templates. So a core template might
> only know that it's going to invoke 'some item template', and then it
> will invoke a specific template that was not even conceived off at the
> time the core template was written. The immediate idea that occurs to me
> is if it were possible to pass a template reference as a parameter and
> invoke it, but that would be kind of awkward and still hard to use, as
> it would have to be passed down through any external templates (although
> it could be deeper in a data structure, so it's possible - say that the
> core template just receives a list of items, and the template reference
> is a member of the item data structure, and so forth - maybe this could
> be done through invoking a 'getOutput' method on the item that invokes
> its own template, which may then invoke core templates perhaps, and then
> is just used as a string for output). Is anything like this possible?
And as I scan docs I can see that this element can be handled by the
syntax <(expr)(argument-list)>... that's embarassing... but thoughts and
ideas on the whole lot are still welcome.
Sam
More information about the stringtemplate-interest
mailing list