I just discovered something that was inhibiting my understanding of TW. 
It's probably somewhere in the docs and I either missed it or forgot it. 
But it might help someone else in the future.

In context of being a parameter, macros and variables behave differently 
from each other when enclosed in quotes.

If macro parameter is set to a variable that is not surrounded by quotes, 
variable is evaluated as expected. (A below).

If macro parameter is set to a variable that is surrounded by quotes, 
variable is *not* evaluated. (B & C below).

If macro parameter is set to a macro, that second macro is expanded *regardless 
of quotes* (D, E, F below).
```
\define mac(mac_param)
<$text text="$mac_param$"/>
\end

\define mac2(mac_param) MMM: $mac_param$

<$set name="var" value="VVV">
A: <$macrocall $name="mac" mac_param=<<var>>/><br>
B: <$macrocall $name="mac" mac_param="<<var>>"/><br>
C: <$macrocall $name="mac" mac_param="""<<var>>"""/><br>
D: <$macrocall $name="mac" mac_param=<<mac2 "AAA">>/><br>
E: <$macrocall $name="mac" mac_param="<<mac2 "AAA">>"/><br>
F: <$macrocall $name="mac" mac_param="""<<mac2 "AAA">>"""/><br>
</$set>
```

A: VVV
B: <<var>>
C: <<var>>
D: MMM: AAA
E: <$macrocall $name="mac" mac_param="MMM: AAA"/>
F: <$text text="MMM: AAA"/>

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to tiddlywiki+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/44dfcc8d-b12a-4c4d-ba36-7febd338b47bn%40googlegroups.com.

Reply via email to