Jump to content

Template:Assistant:Context/delta/doc

From Wikinews, the free news source you can write!

Usage

[edit]

This is part of the Context assistant.

This subtemplate of {{Assistant:Context}} constructs dialog parameter context-delta for the parent template, using parameters passed to the parent.

Examples

[edit]
code output

{{Assistant:Context/delta|foo|bar}}

( ( true "foo" "bar" ) ( false ) )

{{Assistant:Context/delta|template=Assistant:Context/test/-}}

( ( true ) ( false ) ( "Assistant:Context/test/-" ) )

{{Assistant:Context/delta|template=Assistant:Context/test/a|foo}}

( ( true "foo" ) ( false ) ( "Assistant:Context/test/a" "x" "z" ) )

{{Assistant:Context/delta|template2=Assistant:Context/test/a|template3=Assistant:Context/test/b|foo}}

( ( true "foo" ) ( false ) ( "Assistant:Context/test/a" "x" "z" ) ( "Assistant:Context/test/b" "y" "z" ) )

{{Assistant:Context/delta|template4=Assistant:Context/test/b|foo}}

( ( true "foo" ) ( false ) ( "Assistant:Context/test/b" "y" "z" ) )

Internals

[edit]

At this writing, this subtemplate supports specifying up to four additional-templates-to-be-informed. The number four has no special significance; it's a smallish number greater than one. Considering plausible applications, one was deemed not enough. The templates-to-be-informed can't be specified in a single-parameter unbounded list because Module:TScope is pointedly designed to disallow unbounded branching of template calls based on the output of calculation; and a large number of templates-to-be-informed would therefore involve bulkily repetitious wiki markup. Hopefully, four is neither uncomfortable small nor clumsily large.

See also

[edit]