I am returning to the Original Topic as I am having trouble following the discussion, in part because it contains false assumptions and assertions.
It does know the current title, In fact the title is implied.
- Think of a function as a subfilter if you have made use of them.
Let me illustrate with the “non-example” given;
\function .double() [multiply[2]]
\function .square() [power[2]]
\function .compute() [match[3].double[]] ~[power[2]]
<$list filter="[range[5]]">
<<currentTiddler>>={{{ [all[current].compute[]] }}}
</$list>
and
{{{ [range[5]] :map[.compute[]] }}}
- This produces the result as expected in both cases, 3 is only doubled the rest are squared.
- Note: we use map to force an additional filter on all results prior, the same is available inside a list
-
Note:
- CurrentTiddler, storyTiddler etc… can be used inside your function or custom operator however you are responcible for ensuring it has the appropriate value.
\function .simple() [<currentTiddler>addprefix[item-]]
<$list filter="[range[5]]">
<<currentTiddler>>={{{ [all[current].simple[]] }}}
</$list>
Please tell me if other questions arrose later in this topic that are outstanding
Post script:
I see in other conversations that confuse me, my bad, I dont like unrealistic functions or variable names, I prefer to use real world examples, mataphor and analogues. However within these conversations I read little assaumptions and implications that I see are incorect. But the converstion is too complex for me to interupt.
For example: One key advantage of functions is they help you avoid the old bugbear of needing to use Wikify at the last step to “evaluate” at least anything you can do in a filter. SImilarly nthey avoid the need to use the text widget to present simple text and not be treated as a tiddler title.