Subject: Imapflags "hasflag" test interaction with relational draft

From: Alexey Melnikov <[email-masked]>
Date: Tue, 31 Jan 2006 15:21:03 +0000

Ken Murchison has asked me how "hasflag" test interacts with relational 
extension.

hasflag :count will count the number of different flags in a variable.
So
hasflag :count "ge" "MyVariable" "5"

returns true if the number of different flags in MyVariable is >= "5". 
However note that the default comparator is i;ascii-casemap and not 
i;ascii-numeric. I.e. hasflag test doesn't have the comparator 
parameter. Does anybody see any value in adding the comparator parameter 
to hasflag test?

Alexey

---

From: Ken Murchison <[email-masked]>
Date: Tue, 31 Jan 2006 11:54:40 -0500

> parameter. Does anybody see any value in adding the comparator parameter 

No.  RELATIONAL already requires the presence of i;ascii-numeric, so you 
could just state that hasflag :count  uses i;ascii-numeric instead of 
i;ascii-casemap.

-- 
Kenneth Murchison
Project Cyrus Developer/Maintainer
Carnegie Mellon University

---

From: Alexey Melnikov <[email-masked]>
Date: Tue, 31 Jan 2006 17:11:34 +0000

Ken Murchison wrote:

> Alexey Melnikov wrote:
>
>> Ken Murchison has asked me how "hasflag" test interacts with 
>> relational extension.
>>
>> returns true if the number of different flags in MyVariable is >= 
>> "5". However note that the default comparator is i;ascii-casemap and 
>> not i;ascii-numeric. I.e. hasflag test doesn't have the comparator 
>> parameter. Does anybody see any value in adding the comparator 
>> parameter to hasflag test?
>
> No.  RELATIONAL already requires the presence of i;ascii-numeric, so 
> you could just state that hasflag :count  uses i;ascii-numeric instead 
> of i;ascii-casemap.

This is possbile, but I think for all other tests the default comparator 
doesn't depend on match type.

---

From: Ken Murchison <[email-masked]>
Date: Tue, 31 Jan 2006 13:16:34 -0500

> doesn't depend on match type.

Well, i;ascii-numeric is a SHOULD for :count (per Relational), and I 
don't see why this can't be a MUST for hasflag :count, or :count in 
general).

---

From: "Mark E. Mallett" <[email-masked]>
Date: Tue, 31 Jan 2006 13:45:52 -0500

> don't see why this can't be a MUST for hasflag :count, or :count in 

Relational says:

  The COUNT match type SHOULD only be used with numeric comparators.

which is quite different from saying that a different comparator should
be defaulted when using :count .  I think that trying to induce
different default comparators depending on combination of options opens
up a can of worms; i.e. I would agree that the default comparator should
not depend on the match type.

mm