On Tuesday, July 27, 2021 at 5:06:39 AM UTC-7 TW Tones wrote:

> Looking at your example it makes me ask if perhaps a special case operator 
> would be nice 
> Rather than [[$id$]!is[blank]else<id>!is[blank]else[]]
> perhaps [case[$id$,<id>] where the first non blank value is used or 
> nothing at all.
>

The only thing that this eliminates is an implied "!is[blank]" syntax, but 
I can imagine that other conditional filters (e.g., match[], compare[], 
is[tiddler], etc.) might also be useful, so I'd be hesitant to make a 
special "case[...]" operator for this purpose.
In addition, to fit with the existing comma-separated operand syntax (e.g. 
"[search-replace[this],[that]]") your suggestion would written slightly 
differently, like this:

<$vars foo={{{ [case[$id$],<id>,{!!id},{id},2] }}}>

Also note that in the actual TiddlyTools/Macros/edit-list-vars code, I 
switched to using separate filter runs with the "~" (else) prefix.
This allows whitespace to be placed between the runs so that the "cases" 
are much more readable.

-e

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/c5c5408f-47b0-4005-b685-37ee6962088en%40googlegroups.com.

Reply via email to