Can <$macrocall/> be used without parameter names? only parameter position?

40 views
Skip to first unread message

Mohamed Amin

unread,
May 30, 2021, 9:35:57 PM5/30/21
to TiddlyWiki
Hi,

if I've the following macro:
\define myMacro(par1:"A" par2:"B" par3:"C")
$par1$-$par2$-$par3$
\end
I can call it using the short syntax <<myMacro XY>> to get the output = XY-B-C without specify the parameter names (only the position).

But if I use <$macrocall> widget with the same way <$macrocall $name="myMacro" XY /> it seems not working. any idea how to make this work?

My use case,
I've some macro names as "variables", they are not identical but are the same category (so their parameter names are different).
My option now is to re-name all parameters to be the same, but I want to check first if there is way .


Thanks in advance

TW Tones

unread,
May 30, 2021, 9:54:33 PM5/30/21
to TiddlyWiki
Mohammad,

The strait answer is I believe NO, but,

You may be able to create an additional macro, that uses the macrocall widget to convert the position to a named parameter. However this likely reintroduces the same problem, being able to provide parameters values from difference sources such as variables and transclusions etc...

I think what you ask for would be a nice addition to the macrocall widget. Even if a new variable containing all prams needed to be processed within the macro. ie each named parameter is passed and a separate string containing all parameters delimited in some way, perhaps as [[titles]]. Such a mechanism would also help concatenation methods and more. For example providing a macro a set of keyword=value or keyword:value pairs which the macro can parse.

I will continue to think about this
Tones

msameen99

unread,
May 31, 2021, 3:17:49 AM5/31/21
to tiddl...@googlegroups.com
thanks Tones for your reply. 


--
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+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/547850d6-65f7-462d-aa68-6ce1a3257e2cn%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages