It's looking for unique *values* of the field. Apparently, "nothing" is a 
value. So the first tiddler for which the value is "nothing" gets included.

I did say it was unintuitive ;-)

On Sunday, December 8, 2019 at 12:00:59 PM UTC-8, Mohammad wrote:
>
> Hi Mark!
>  But this is confusing! Why it return one tiddler if there is nothing to 
> return like
>
> [each[nella]] 
>
> There is no tiddler has field nella, still we have one at the output?
>
> --Mohammad
>
> On Sunday, December 8, 2019 at 11:24:32 PM UTC+3:30, Mark S. wrote:
>>
>> I don't think it's a bug *per se*, but it is unintuitive.
>>
>> From tiddlywiki.com
>>
>> As long as the value of the field is unique (i.e. has not been 
>>> encountered before), the title is appended to the output.
>>
>>
>> and
>>
>> If a tiddler does not contain field F, it is treated as if the value of 
>>> the field were empty.
>>>
>>
>>
>> Now use filter 
>>
>> [all[tiddlers]limit[1]]
>>
>> You'll see that $:/library/sjcl.js 
>> <https://tiddlywiki.com/#%24%3A%2Flibrary%2Fsjcl.js> is the first item 
>> on the list.
>>
>> So .... when "each" sees the first item in the list tiddlers, it looks at 
>> the field "color" in $:/library/sjcl.js. There is no field "color". So 
>> it saves the "" value on it's list of values that it has seen, and appends 
>> $:/library/sjcl.js 
>>
>> to the output list.
>>
>> If you delete $:/library/sjcl.js, you'll see that now "each" returns 
>> $:/boot/bootprefix.js, 
>> which is the next tiddler at tiddlywiki.com.
>>
>> In real use, you would usually be using "each" in conjunction with "get" 
>> or some other filter, so this would not be a problem.
>>
>> HTH
>>
>>
>>
>>
>>
>> On Sunday, December 8, 2019 at 11:26:39 AM UTC-8, Mohammad wrote:
>>>
>>> On https://tiddlywiki.com/#each%20Operator%20(Examples)
>>> Look at the first example
>>>
>>> [each[color]]
>>>
>>> The output result show
>>>
>>> $:/library/sjcl.js <https://tiddlywiki.com/#%24%3A%2Flibrary%2Fsjcl.js>
>>>
>>> But it has no color field!
>>>
>>> --Mohammad
>>>
>>

-- 
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/85ed4271-c760-4001-9d86-548ce8a2bee7%40googlegroups.com.

Reply via email to