[Top] [All Lists]

Re: NULL vs. ""

2005-05-27 07:05:55

On Fri, 2005-05-27 at 14:49 +0200, Arnt Gulbrandsen wrote:
If you'll look at draft-newman-comparator (currently expired) you'll see 
that "NULL strings" are mentioned in section 4.6, the behaviour of 
comparing, equality testing and substring testing on NULL strings is 
defined, but a NULL string itself is defined only implicitly as "a 
string that contains no characters and is not the same as an empty 

aha, thanks for the pointer for where you're coming from.

In the context of sieve, that would seem to encompass the value of an 
absent header field, the value of a variable that is initialized from 
such a header field, etc.


are you proposing to change the semantics of the header test?

I think I'm not.

I agree it's not generally true, but I'm not sure whether it's completely 

I want to either kill NULL strings in the comparator draft or provide a 
raison d'etre in the form of a good example. Either is fine with me. 
And I want to be compatible with the established use of comparators.

   If a header listed in the header-names argument exists, it contains 
   the null key ("").  However, if the named header is not present, 
   it does not contain the null key.  So if a message contained the 

           X-Caffeine: C8H10N4O2

   these tests on that header evaluate as follows:

           header :is ["X-Caffeine"] [""]         => false
           header :contains ["X-Caffeine"] [""]   => true

There are no null strings here, only empty strings, so I don't think 
it's relevant.

the example wasn't very relevant here, since the header exists.
consider instead:

   header :contains "X-Absent" ""

the LHS of the comparison is the value of lookup_header("X-Absent"), and
it returns a NULL value (do not confuse with "null key" :-).  it seems
to me that the comparator draft needs to support NULL values to be able
to support Sieve semantics.
Kjetil T.

<Prev in Thread] Current Thread [Next in Thread>