Until recently, I was not aware of \procedure. I don’t use them yet.
I can’t really see in the doc what it does better than \define. Except using the \parameters pragma. But the docs don’t really show why it would be such a great feature. Would the combination of the two works better (than \define) if I use functions (defined by \function) in my filter? And again, how’s that?
Also’ in the " Macro Definition Syntax" there is no mention of \procedure. What are we creating with \procedure?
otherwise I don’t see the use of \parameters(a1). This is indeed the case (just tested it). I think the doc has wanted to be a bit shorter that it should have been.
Now I krow that \procedure is the new macro mechanism and I ought not to use \define anymore. A good point for this being there is no more (slow) text substitution.
So we definitely must update the doc about macro, mustn’t we?
I read in this help page that with \defined macro called along the usual way, that “all wikitext and variable substitution and textual substitution takes place”.
But this is not illustrated. I may be a bit dumb’ but what is the difference with “All wikitext and variable substitution takes place”? There in tiddler called “textual substitution” (or including that in its title) to enlight me. I //suspect// this is the bit about using $myFirstArg$ for instance. Is that so?
I don’t know. I had exactly the same question when I read it – I wondered why “textual substitution” was added. I figured I’d glossed over something and never did go back to see what I’d missed.
In fact one may argue its poorer as the variable substitutions are now ONLY as variables. However with the parameters widget and “functions” now available (that allows many forms of substitution), I think we have “won back” the functionality.
The advantage of parameters as “only” variables is we can now focus on parameters as having a consistent representation.
The way the new functions work you can replace 90% even 100% of the reasons for using the \define substitutions by moving them into filters (\functions) which has it’s own values. See also substitution operator.
(As I understand it) keep in mind this is part of gradual change and a move to procedures is part of a larger picture by the core team, the value will only be fully realised in time
Despite the above this is also true
Define and substitution features are only depricated and I cant see them ever going completely (speculation).
But is wise to migrate away from them.
You can nest \defines inside custom widgets and procedures, and use them in that scope.
You can call defines and procedures, with <$transclude $variable= and procedures with <$macrocall $name= when you do not need to use a feature of the new $transclude $variable.
using functions, and the new backtick attribute values allows you to avoid definition of a macro (\define) by providing an “evaluated value” as an attribute value right where it is needed.