What does the qualify macro do

137 views
Skip to first unread message

Mohammad

unread,
Jul 5, 2018, 9:43:20 AM7/5/18
to TiddlyWiki
Look at

I dont get what really the qualify macro do! Does it generate some states to be used with widgets like Reveal widget?
If so, how and when these states are removed?

/Mohammad

Jeremy Ruston

unread,
Jul 5, 2018, 9:46:37 AM7/5/18
to tiddl...@googlegroups.com
Hi Mohammad

If you didn’t see it, there’s more information about the state mechanism here: https://tiddlywiki.com/#qualify%20Macro

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 tiddlywiki+...@googlegroups.com.
To post to this group, send email to tiddl...@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/f99adb64-807a-4ed8-9693-edd2098efca1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Mohammad

unread,
Jul 5, 2018, 9:52:05 AM7/5/18
to TiddlyWiki
Hello Jeremy!
 I read that, but actually I didn't get the real purpose!

/Mohammad

Alex Hough

unread,
Jul 5, 2018, 9:58:34 AM7/5/18
to TiddlyWiki
Jeremy,

To see the difference you have to open up the tiddler.

I think the docuemntation example is possibly a bit confusing.

For learning I think that perhaps the "try it" feature kind of gets in the way of opening the tiddler and seeing inside.

the documentation tiddler macro adds another level of complextity as the transcluded tiddler contains such a macro.

... not a major point, but I  find qualify difficult to get my head round.

Why is is called "qualify"? To me the word means qualify as in "we qualified for the world cup"...

best wishes

Alex

To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywiki+unsubscribe@googlegroups.com.

To post to this group, send email to tiddl...@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.

Mark S.

unread,
Jul 5, 2018, 11:10:13 AM7/5/18
to TiddlyWiki


On Thursday, July 5, 2018 at 6:58:34 AM UTC-7, AlexHough wrote:
Jeremy,

To see the difference you have to open up the tiddler.

I think the docuemntation example is possibly a bit confusing.

For learning I think that perhaps the "try it" feature kind of gets in the way of opening the tiddler and seeing inside.


Yes. I agree with this. I want to see (and maybe borrow) the real code, not carefully orchestrated code where I can't see what's really going on. Also, some of the "try this" examples are broken, because they depended on data relations that no longer exist.

"Qualify" can also mean something like "to define more carefully", So the qualify macro helps create state tiddlers that won't be confused with each other. Or at least that was my interpretation.

 -- Mark

Jeremy Ruston

unread,
Jul 5, 2018, 11:19:16 AM7/5/18
to tiddl...@googlegroups.com

On 5 Jul 2018, at 16:10, 'Mark S.' via TiddlyWiki <tiddl...@googlegroups.com> wrote:


"Qualify" can also mean something like "to define more carefully", So the qualify macro helps create state tiddlers that won't be confused with each other. Or at least that was my interpretation.

That’s right. The qualify macro takes a plain state tiddler title, and decorates it in a way that is unique to the place in the widget tree that it is rendered.

It exists so that we can generate independent state tiddlers for the dropdown status of things like tag pills which might be displayed multiple times on the screen at once.

Best wishes

Jeremy.

Mohammad

unread,
Jul 5, 2018, 11:46:16 AM7/5/18
to TiddlyWiki
Thank you Mark! Thank you Jeremy!

Yes, the name is confusing! I would rather call it getNewState, genState or something like that!

Anyway, I learned know what it is. It generate unique state tiddlers!

/Mohammad

TonyM

unread,
Jul 5, 2018, 8:40:06 PM7/5/18
to TiddlyWiki
Mohammad,

If I may explain the Qualify macro for you in my way.

Just as the <<now>> macro returns the time and date
eg: 10:21, 6th July 2018

The <<qualify>> macro returns a "unique number" 
eg: -85796999

and as Jeremy Described "in a way that is unique to the place in the widget tree that it is rendered"
which I may add includes the title, change the title and the result changes.

Now looking at the result returned you can see it is prefixed with a hyphen, this is a clue that you can add another value

<<qualify "mykeyword">>
gives us mykeyword-85796999

Basically it generates on the fly a unique number based on its context which you can use with prefixs to generate more than one for the current context.

It does not matter if the number changes (Like as the title changes) because it reliably returns the same number in the current wiki everywhere it is used.

I suggest when using the <<qualify>> macro to create temp tiddlers <<qualify "$:/temp/mykeyword">>

The world makes a lot of sense (in English), when you think about it, you are asking it to Qualify mykeyword so it is unique in this time and place, so you will not accidentally overwrite or use a temporary tiddler from something else.

Of course this use of the word Qualify may be unfamiliar to many.

Now you may be able to see why it is commonly used for the title of State Tiddlers, this is possibly the only use, however someone may use it in other ways.

Regards
Tony

Mohammad

unread,
Jul 5, 2018, 10:32:08 PM7/5/18
to TiddlyWiki
Many thanks Tony!

Cheers
Mohammad
Reply all
Reply to author
Forward
0 new messages