Hi Erwan,
 

> It's true that it's a bit counter-intuitive, but I would assume that it's 
> more common to use "has" or "get" in order to do something with the field 
> value, and in these cases it's more convenient not to have to check if the 
> value is empty before using it. That's how I interpreted it at least ;)
>

That is true for *get*, but I would not agree that it is for *has*. To me 
"empty value" is or at least should be a value, meaning: not the same as 
"undefined". But yes, there are practical applications where I presume one 
would want to subsume "undefined" as "blank".

A) as for *has*:

Perhaps the *has *filter operator can be given some *suffix *to tell it to 
also include those that are blank, e.g. any of:

has:field[some-field]

Meaning: get all tiddlers that have the field, regardless of whether or not 
a value is set.

B) As for *get*:

Not sure, but I believe we cannot add "empty items" to a filter set, e.g. 
["foo","","","bar baz"]... for whatever reason... so they essentially get 
removed. This may be problematic for some situations where you actually 
want empty items, e.g. if you first iterate titles (in a pseudo-column A) 
and then again iterate the same number of items (in pseudo-column B) while 
retrieving a given value with respect to them. At that point, you may not 
want items to get omitted just because they were empty / or undefined 
...but rather want the empty value.

One way — assuming that would not break other filters — would be to allow 
something like:

get:empty[some-field]

To instruct the iteration to also index blanks, possibly assuming 
*undefined* to meaning *blank*.

So that, if I did:

<$list filter="[tag[HelloThere]get[foo]]">
value: <<currentTiddler>>
</$list>

...with only one tiddler tagged HelloThere having the field *foo* defined, 
I would still get a list with the amount of items of whatever number of 
tiddlers have the tag HelloThere.

Best wishes,

— tb

-- 
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 post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/74912df2-5756-4868-8a80-3117b256672d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to