Working examples of <$importvariables> and \import with helper macros

49 views
Skip to first unread message

David Nebauer

unread,
Oct 7, 2019, 7:05:07 AM10/7/19
to TiddlyWiki
I'm experimenting with the use of <$importvariables> and \import to scope helper macros to the tiddler containing the main "parent" macro. So far I haven't even had a glimmer of success getting either to work. Before I even get to the point of posting example tiddlers, can anyone point me to a non-trivial working example of either mechanism for importing macros? That way I can see if I'm even on the right track.

Regards,
David.

PMario

unread,
Oct 7, 2019, 11:02:55 AM10/7/19
to TiddlyWiki
Hi David,

The attachment contains a small experiment, that may be able to put you on track. .. It's from an other discussion at github, which may or may be not related.

You can drag and drop import it.

The test tiddler is: test-notify, A, B, C are just some helpers.

have fun!
mario
button-hack-concept.json

David Nebauer

unread,
Oct 7, 2019, 11:37:04 AM10/7/19
to TiddlyWiki
Thanks, Mario, for your response. I actually figured it out myself before checking back with GG. The trick was to put the import pragma inside the parent macro before calling the helper macro. I've not previously encountered a pragma command that didn't go at the top of the tiddler. That, needless to say, doesn't work for \import in this use case.

This trick is going to be very useful. I won't have to pollute the macro/variable namespace with helper macro names.

Please feel free to close this topic. (GG won't let me as I created the topic.)

Regards,
David.
Reply all
Reply to author
Forward
0 new messages