In chat, @cgnieder just pointed me to xtemplate after poking around my own startup ltx3obj.
In section 3, the documentation states (at the time of writing):
An object type (sometimes just "object") is an abstract idea of a document element that takes a fixed number of arguments corresponding to the information from the document author that it is representing. A sectioning object, for example, might take three inputs:
"title", "short title", and "label".
But isn't this just a data structure at that point? Wiktionary defines an object as an instance of a class, and it defines a class as
A set of objects having the same behavior (but typically differing in state), or a template defining such a set.
Thus, objects have state and behavior, which I clearly put forward in ltx3obj.
I find it difficult to believe that xtemplate does not have a means of specifying behavior for a class (or object).
Unfortunately, I can't find any explicit support other than templates, which actually do the work of defining what an object is rather than just saying it is.
Moreover, templates do not (in a way that is immediately obvious) support methods.
So in conclusion, I have three very closely related questions:
- Is there a way
xtemplatecan be extended to include this? - Does
xtemplatealready include this functionality, and is just non-obvious about it from the outside looking in? - If not, are there any plans to officially include this functionality?
xtemplateis about. Note that we (the team) feel that there are still big issues to solve with whatxtemplateis for. – Joseph Wright Aug 18 '13 at 15:52prototypebranch of the linked repo is actually coming together quite nicely :) – Sean Allred Jul 04 '15 at 21:00templatetag, it is not really suited. That will push it back on top and into the awareness of the team members around ;-) – Johannes_B Jul 04 '15 at 21:02