Subject: acap, comparators, and semicolons

From: Tim Showalter <[email-masked]>
Date: Tue, 2 Dec 1997 20:54:09 -0500 (EST)

So the contains, is, & matches tests use ACAP's comparator registry.  ACAP
defines 3 comparators, i;octet, i;ascii-casemap, and i;ascii-numeric.

Looking at the sieve-00 implementation Rob hacked up ages ago, i;octet is
the default and i;ascii-casemap is what used to be a "-nocase" change to the
keyword.

There are two problems.  The first is that the comparator argument contains
a ; which makes the parser gross.  For the moment, I guess I'm going to
leave the "i;" part out as a hack (which is what the draft says because I
didn't read the ACAP drafts enough).

The easy remedy to this is to just put the comparator in quotes so that
instead of being part of the keyword, it's just an argument to the command.
There are a few other cases where optional arguments need to be used.

Any suggestions?

I'm considering something like

  compare-test-keywords	= "is"/"matches"/"contains"
  comparator-name	= string
  optional-comparator	= "-comparator" WSP comparator-name
  compare-test		= compare-test-keywords WSP [optional-comparator]
  header		= "header" WSP string-list WSP compare-test 
				WSP string-list

So comparator-keywords are moved out of the parser.  (Command parsing should
probably be moved out of the parser too, and resolved like symbols in a real
language.)

-- 
                                           Tim Showalter [email-masked]

---

From: Chris Newman <[email-masked]>
Date: Sat, 06 Dec 1997 00:07:04 -0800 (PST)

> There are a few other cases where optional arguments need to be used.

How about just adding a comparator command, which effects all later
searches:

Comparator "fr-ca;iso;strength=3";

This cleans up the grammar and probably does what the user wants.

People interested in the syntax for comparator naming should be at the
LESSOR BOF Monday morning at the IETF.

It's a shame nobody asked for a Sieve BOF, but I suppose a 5 minute plug
for Sieve at the Spam BOF will be good enough.

		- Chris

P.S. I think we should stop using "-" in tokens in Sieve.  An extension
which provided basic math operations would be useful, so "-" should be
reserved for subtraction and negation.

---

From: Tim Showalter <[email-masked]>
Date: Sat, 6 Dec 1997 04:47:57 -0500 (EST)

> This cleans up the grammar and probably does what the user wants.

This isn't too bad, but...

if header "from" contains "tjs" {
	Comparator "i;octet"
} else {
	Comparator "i;ascii-casemap"
}
# foo

By point foo, it's impossible to tell what the comparator is, and I'm not
sure I like this.

I still believe that optional arguments need some coverage in the draft or
they'll be implemented in incompatible ways when someone finally finds
something they can't hack around.

> for Sieve at the Spam BOF will be good enough.

I'm hoping some interested people can get together some night, but I don't
know which night.

> reserved for subtraction and negation.

Ok, that's true.  I'd still like to introduce optional arguments in some
standard way.  Luckily your argument will discourage anyone suggesting '/'
as well.