Skip to content

Is there an advantage of using "$param$" instead of <<__param__>> and "$(nonlocalvar)$" instead of <<nonlocalvar>> ? #6332

Answered by Jermolene
nilslindemann asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @nilslindemann

The history was roughly in the following order.

Macros were first implemented with parameters based on text substitution (ie, the $param$ syntax). The implementation was and is very simple: before using the value of the macro a search and replace is performed for each specified $param$ with the corresponding value (the value specified when invoking the macro, or the default value if the parameter was not specified in the invocation).

The weakness of that approach became clear very quickly. For a long time the core had problems with tiddler titles that ended in double quotes because of situations like this:

\define mymacro(param)
<$macrocall $name="anothermacro" something…

Replies: 5 comments 12 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
4 replies
@kookma
Comment options

@nilslindemann
Comment options

@Jermolene
Comment options

@nilslindemann
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@nilslindemann
Comment options

Answer selected by nilslindemann
Comment options

You must be logged in to vote
7 replies
@nilslindemann
Comment options

@btheado
Comment options

@nilslindemann
Comment options

@btheado
Comment options

@nilslindemann
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
5 participants