The difference is due to the enlist filter.  In the first test case, [[]] 
is parsed as a tiddler title with the empty string "" as it's value.  
Weird, but it's still added to the input title list of the filter.  But in 
the enlist filter, it does string parsing to determine all the titles in 
the parameter, and it determines there aren't any in the param, so it 
doesn't add anything to the list of input tiddlers titles.

On Friday, April 5, 2019 at 8:46:40 AM UTC-4, Mohammad wrote:
>
> Hi S.S.,
>  Thank you for sharing! 
> I don't understand the result of test 3 in two cases! Why they are 
> different?
>
> --Mohammad
>
>
>
> On Friday, April 5, 2019 at 3:48:16 PM UTC+4:30, S. S. wrote:
>>
>>
>> When trying to test for an *either/or* parameter, I used a filter, and 
>> found this interesting behaviour:
>>
>> \define test1(a b)
>> <$list filter="[[$a$]] [[$b$]] +[limit[1]]" emptyMessage="c"></$list>
>> \end
>> \define test2(a b)
>> <$list filter="[enlist[$a$]] [enlist[$b$]] +[limit[1]]" emptyMessage="c"
>> ></$list>
>> \end
>>
>> !! Test 1
>> 1. <<test1 a:A   b:B>>   <br>
>> 2. <<test1 a:A   b:"">>  <br>
>> 3. <<test1 a:""  b:B>>   <br>
>> 4. <<test1 a:""  b:"">>  <br>
>>
>> !!Test 2
>> 1. <<test2 a:A   b:B>>   <br>
>> 2. <<test2 a:A   b:"">>  <br>
>> 3. <<test2 a:""  b:B>>   <br>
>> 4. <<test2 a:""  b:"">>  <br>
>>
>>
>> Test 1
>>
>> 1. A
>> 2. A
>> 3.
>> 4.
>>
>> Test 2
>>
>> 1. A
>> 2. A
>> 3. B
>> 4. c
>>
>> Perhaps useful too keep in mind!
>>
>> Cheers
>>
>>
>>
>>

-- 
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 https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/4e9b82b6-495c-426c-b186-45aed22779b7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to