I had tested my stuff in the upcoming 5.1.24 online as the screen capture show.
With the latest pieces of information you gave, I can see that there can be a reason of my code failure. This is relief.
I have the decided to have a go at variables updating themselves, to see what it can do. Here is my test code:
====
\define just-count()
<$set name=z value="42">
<$action-log $$message="1." $$filter=z/>
<$set name=z1 value="z1=<<z>>">
<$set name=z filter="[<z>add[3]]">
<$action-log $$message="2." $$filter=z/>
<$set name=z2 value="z2=<<z>>">
<$set name=z filter="[<z>add[12]]">
<$action-log $$message="3." $$filter=z/>
<$set name=z3 value="<<z1>> ; <<z2>> ; z3=<<z>>"/>
<<z3>>
<$action-log $$message=<<z3>>/>
</$set></$set></$set></$set></$set></$set>
\end
\define only-count()
<$set name=z value="42">
<$set name=z1 value="z1=<<z>>">
<$set name=z filter="[<z>add[3]]">
<$set name=z2 value="z2=<<z>>">
<$set name=z filter="[<z>add[12]]">
<$set name=z3 value="<<z1>> ; <<z2>> ; z3=<<z>>">
only-count: <<z3>>
</$set></$set></$set></$set></$set></$set>
\end
\define wiki-count()
<$set name=z value=42>
<$wikify name=z1 text="z1=<<z>>">
<$set name=z filter="[<z>add[3]]">
<$wikify name=z2 text="z2=<<z>>">
<$set name=z filter="[<z>add[12]]">
<$wikify name=z3 text="<<z1>> ; <<z2>> ; z3=<<z>>">
wiki-count: <<z3>>
</$wikify></$set></$wikify></$set></$wikify></$set>
\end
<$button actions=<<just-count>>>
just count (see console)!</$button>
<br><<only-count>>
<br><<wiki-count>>
======
output in tiddler:
only-count: z1=57 ; z2=57 ; z3=57
wiki-count: z1=42 ; z2=45 ; z3=57
summarized output in console if button pressed:
1. z=42
2. z=45
3. z=57
with the button, it's fine but is there a problem with the number of closing </$set> or is a single one just fine? (not in the context of my code, but it could be the case if I was not defining z1, z2 and z3 in just-count macro)
without the button, we can see that the transitional values of z must be captured, hence my using the wikify widdget. Otherwisi all occurrence of z have the final value. I'm pretty sure this is a feature, not a bug, isn't it?
This being said, I will have a try at recursion and report here.