I’m playing with the new concept of procedure in TW 5.3 prerelease, and I must say that so far it feels much easier than traditional macros for an amateur like yours truly.
I probably have some misunderstanding about this point though: apparently there’s something not working when I pass a reference as argument, like this:
\procedure example(n:"1")
<<n>> {{{[<n>multiply[3]]}}}
\end
direct value n: <<example n:4>>
field value n: <<example n:{{!!param}}>>
In the second case the tillder must have a field param with value 4 (or any number)
The first call gives the expected result 12, but the second one gives 0 because the <n> inside the filter appears undefined, even though the value is printed.
Am I missing something? Isn’t this supposed to work?
@Surge is right to recommend using a widget. Inside the variable expansion syntax (<<>>) wikitext is not expanded. While using the macrocall widget would work, my preference is to use the transclude widget. For example
<$transclude $variable=example n={{!!param}}/>
In 5.3, parameterized wikitext can be stored in tiddlers or in variables (\define, \procedure, \widget, \function, $let, $set, $vars). The $transclude widget unifies access to both of these via either <$transclude $variable="somevar"/> or <$transclude $tiddler="sometiddler"/>
Macro call is the long form of calling a macro and allows parameters not allowed in a short form ‘<< >>’ in 5.3.0 your can do something similar using the transclude widget and the $variable parameter.