From a2606781b717a79c5c6d28da2c870a9bf5d68ecb Mon Sep 17 00:00:00 2001 From: Tobias Beer Date: Wed, 9 May 2018 19:01:03 +0200 Subject: [PATCH] Docs: Add "Named vs unnamed parameters" section (#3022) to clarify the risks of using unnamed parameters, esp. w/ states, see #1252 --- .../tw5.com/tiddlers/wikitext/Macro Calls in WikiText.tid | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/editions/tw5.com/tiddlers/wikitext/Macro Calls in WikiText.tid b/editions/tw5.com/tiddlers/wikitext/Macro Calls in WikiText.tid index ecccc2e4c..f4899fbd6 100644 --- a/editions/tw5.com/tiddlers/wikitext/Macro Calls in WikiText.tid +++ b/editions/tw5.com/tiddlers/wikitext/Macro Calls in WikiText.tid @@ -20,3 +20,7 @@ The syntax is actually a shorthand for a <<.wlink MacroCallWidget>> widget. The As macros are simply parameterised [[variables|Variables]], a variable's value can be inserted using the same techniques. [[Examples|Macro Calls in WikiText (Examples)]] + +!! Named vs.unnamed parameters + +In the wikitext notation, using named parameters is always the safer choice compared to defining values only. Not naming parameters may have confusing side effects. For example, imagine the first parameter of some macro specifies a [[state tiddler|StateMechanism]] while the second one is intended for a [[template|Transclusion with Templates]] tiddler. Should you accidentally forget to define the first parameter or are confused about the order, the next time your macro is run, which might even be triggered using the preview, your template tiddler may inadvertently be overriden with what was intended to be the state.