What can be accomplished with procedures that is not possible or difficult to do with macros?

Very cool! I expect to use these quite a bit. With your help, I understand that I can design a repeatable pattern (procedure) whose various parameter-values automatically follow whatever I can specify using wikitext and filter expressions (etc.)… PLUS I retain the option to override any of those parameters “on the fly” as needed when I invoke it. Perfect!

I’m one of those people who struggle to unpack nonsense variables (uta, p0 p1 p2) while I’m still learning. My brain gets distracted by wondering, “Wait, what is “uta” supposed to mean?”

So, for anyone else out there like me in this way, I offer below a simple variant on @Mohammad’s example, using words and code that might intuitively make sense for someone trying to see how they can put this power to use.

In the example below, the procedure specifies parameter values around common-sense conditionals with the new conditional shortcut syntax: I want to add modified date only if it differs from create date; I want to include a nudge to upgrade, iff TiddlyWiki version is not 5.3.3, etc.:

\procedure tiddler_overview()

<$parameters 

name=
"""<% if [{!!title}prefix[Draft]] %> @@oops, still a draft@@ <% else %> <$link/> <% endif %>""" 

date-summary=
"""//<$view field=created format=date template="DDth mmm YYYY" />//
<% if [{!!modified}!match{!!created}] %> (then updated on <$view field=modified format=date template="DDth mmm YYYY" />)
<% endif %>"""

version=<<version>>

vers=
"""<% if [<version>match[5.3.3]] %> ✅ <<version>> (current version) <% else %> version <<version>> (Please [[update here|https://tiddlywiki.com/]]) <% endif %>"""

>

!!!This tiddler demonstrates ''<<name>>''. It was created on ''<<date-summary>>'' using TiddlyWiki ''<<vers>>''.

</$parameters>

\end

<<tiddler_overview name:"The Power of Procedures">>

<<tiddler_overview date-summary:"a cloudy day long ago" version:"5.3.1">>

Result:

1 Like