On Mon, Dec 2, 2013 at 4:30 PM, Stephan Hradek <[email protected]>wrote:
> So I found one way which seems to work - but I don't see the logic in it.
>
> \define the_link()
> [[Comment for '$(x)$']]
> \end
>
> \define okay_link()
> <$set name="x" value={{!!title}}>
> <<the_link>>
> </$set>
> \end
>
> <<okay_link>>
>
>
> A similar way, but one level less does not work:
>
> \define nok_link()
> <$set name="x" value={{!!title}}>
> [[Comment for '$(x)$']]
> </$set>
> \end
>
> <<nok_link>>
>
>
> The reason that the second example doesn't work is because the variable
'x' doesn't exist at the time that the macro parameters and variables are
being substituted. The nested macros are a way around that.
> To be honest: I find this quite confusing (and frustrating).
>
> What's most confusing: We have several ways of accessing similar stuff.
>
> At least we have:
>
> $parameter$ - for macro parameters
> $(variable)$ - for variables
>
> It seems to me as if these variables are a kind of a global for macros but do
> not work outside of macros.
>
> <$set name="variable" value="val">
> here we can't use $(variable)$
> while <<macro>> will be able to use it
> </$set>
>
>
> Variables and macros are actually the same thing.
Variables do work outside of macros (via the <<variable>> syntax, or
<$macrocall> widget), but there's no text substitution outside of macros,
which is why the $(variable)$ syntax doesn't work outside of macros.
Best wishes
Jeremy
>
>
>
>
> --
> 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 [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/tiddlywiki.
> For more options, visit https://groups.google.com/groups/opt_out.
>
--
Jeremy Ruston
mailto:[email protected]
--
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 [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/tiddlywiki.
For more options, visit https://groups.google.com/groups/opt_out.