On 29.05.2012 18:06, Gabriel Wicke wrote:
On 05/29/2012 05:12 PM, Daniel Kinzler wrote:
On 29.05.2012 17:02, Gregor Hagedorn wrote:
I am convinced if you can explain: the scope of
this setting will
always be identical to template parameters. For example, it will not
be inherited if a template calls another template.
Hehe, good catch. I have been thinking about this, and I think that in the case
of default items, it would be consistent to let "sub"-templates (nested
template
calls) inherit the item set by a template further up. I'm not sure how this is
currently handled by the preprocessor. It's something to be investigated (maybe
we can have a chat with Tim about this in Thursday...)
Both the PHP preprocessor and Parsoid rely on template expansions being
purely functional for a single parser pass (see for example line 118ff
in Preprocessor_DOM.php). This means that a full expansion subtree can
be reused / cached if the parameters match.
Thanks for providing details here!
This would be the case, since the local "variable" indicating the
"local"
default item would be set using a parser function call in the template, and
would depend solely on the template parameters (or, trivially, use a static item
id).
It is possible to add scoped variables, but we'd
have to carefully
consider the implications for caching, implementation complexity and
usability.
Since the scoped var does not depend on any external information besides
template parameters, I don't expect problems here.
-- daniel
--
Daniel Kinzler, Softwarearchitekt
Wikimedia Deutschland e.V. | Eisenacher Straße 2 | 10777 Berlin
http://wikimedia.de | Tel. (030) 219 158 260
Wikimedia Deutschland - Gesellschaft zur Förderung Freien Wissens e.V.
Eingetragen im Vereinsregister des Amtsgerichts Berlin-Charlottenburg
unter der Nummer 23855 B. Als gemeinnützig anerkannt durch das Finanzamt
für Körperschaften I Berlin, Steuernummer 27/681/51985.