OK, I got great input from @etardiff and @tw-FRed for “sub-problems” to the following (here and here).
Below is the full problem, but here is first a little “symbolic illustration” to give an immediate sense of the problems essence (disregard the colors):
<$wikify name=X
text=<$transclude $variable=foo arg=<<currentTiddler>>/>
> ...
(I know why the above doesn’t work, I don’t know how to avoid it)
OK, the real problem is as follows:
Here’s a dictionary titled dic:
tiddler1: pending
tiddler2: resolved
tiddler3: pending
...
Tiddlers are tagged such that they form a branching tree; i.e every tiddler has an arbitrary number of children tagged with the parent title.
The following procedure lists all children and grandchildren that are not resolved:
\function resolved() [[dic]indexes[]enlist-input[]] :map[[dic]getindex<currentTiddler>match[resolved]then<currentTiddler>] +[format:titlelist[]join[ ]]
\procedure unresolved(tid)
<$list filter="""[tag<tid>]""">
{{{ [<currentTiddler>] -[enlist<resolved>] }}}
<$transclude $variable="unresolved" tid=<<currentTiddler>> />
</$list>
\end
Problem
How many unresolved children/grandchildren do tiddlers tagged “foo” have?
<$list filter="[tag[foo]]">
somehow count the output form the procedure
but the procedure needs the current tiddler as input
</$list>
Thank you!