Re: comparators and "error"

Dave Cridland <dave@cridland.net> Wed, 10 May 2006 22:23 UTC

Received: from balder-227.proper.com (localhost [127.0.0.1]) by balder-227.proper.com (8.13.5/8.13.5) with ESMTP id k4AMNAaV084699; Wed, 10 May 2006 15:23:10 -0700 (MST) (envelope-from owner-ietf-mta-filters@mail.imc.org)
Received: (from majordom@localhost) by balder-227.proper.com (8.13.5/8.13.5/Submit) id k4AMNALc084698; Wed, 10 May 2006 15:23:10 -0700 (MST) (envelope-from owner-ietf-mta-filters@mail.imc.org)
X-Authentication-Warning: balder-227.proper.com: majordom set sender to owner-ietf-mta-filters@mail.imc.org using -f
Received: from pythagoras.zen.co.uk (pythagoras.zen.co.uk [212.23.3.140]) by balder-227.proper.com (8.13.5/8.13.5) with ESMTP id k4AMN7DK084690 for <ietf-mta-filters@imc.org>; Wed, 10 May 2006 15:23:09 -0700 (MST) (envelope-from dave@cridland.net)
Received: from [217.155.137.60] (helo=turner.dave.cridland.net) by pythagoras.zen.co.uk with esmtp (Exim 4.30) id 1Fdx5F-0001UV-Re; Wed, 10 May 2006 22:23:05 +0000
Received: from localhost (localhost.localdomain [127.0.0.1]) by turner.dave.cridland.net (Postfix) with ESMTP id C8232498007; Wed, 10 May 2006 23:23:06 +0100 (BST)
Received: from turner.dave.cridland.net ([127.0.0.1]) by localhost (turner.dave.cridland.net [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 07253-09; Wed, 10 May 2006 23:23:03 +0100 (BST)
Received: from peirce.dave.cridland.net (unknown [IPv6:2001:4bd0:2029:0:2e0:81ff:fe29:d16a]) by turner.dave.cridland.net (Postfix) with ESMTP id 9F0F9498006; Wed, 10 May 2006 23:23:01 +0100 (BST)
Date: Wed, 10 May 2006 23:22:59 +0100
Subject: Re: comparators and "error"
References: <buylDuhckrLTBjUJ7Xr9Kg.md5@libertango.oryx.com> <4461F280.3050900@isode.com> <24437.1147282219.539822@peirce.dave.cridland.net> <oyvlQ4PzQ3IFvV/ROIj/PA.md5@libertango.oryx.com>
In-Reply-To: <oyvlQ4PzQ3IFvV/ROIj/PA.md5@libertango.oryx.com>
MIME-Version: 1.0
Message-Id: <6379.1147299780.390091@peirce.dave.cridland.net>
From: Dave Cridland <dave@cridland.net>
To: Arnt Gulbrandsen <arnt@gulbrandsen.priv.no>
Cc: Alexey Melnikov <alexey.melnikov@isode.com>, ietf-mta-filters@imc.org
Content-Type: text/plain; charset="us-ascii"; format="flowed"
X-Virus-Scanned: by amavisd-new-20030616-p10 (Debian) at dave.cridland.net
X-Originating-Pythagoras-IP: [217.155.137.60]
Sender: owner-ietf-mta-filters@mail.imc.org
Precedence: bulk
List-Archive: <http://www.imc.org/ietf-mta-filters/mail-archive/>
List-ID: <ietf-mta-filters.imc.org>
List-Unsubscribe: <mailto:ietf-mta-filters-request@imc.org?body=unsubscribe>

On Wed May 10 20:09:17 2006, Arnt Gulbrandsen wrote:
> 
> Dave Cridland writes:
>> I'm really not so sure. On the face of it, it sounds like bad 
>> design, but I think there's at least two cases here - an attempt 
>> to compare "fish" and "bicycle", and an attempt to compare "fish" 
>> and "2". I have a feeling this is an important distinction.
> 
> It is precisely the distinction between "neither input is valid" 
> and "one input is valid, the other not".
> 
>> Arguably, "fish" is equal in numeric value to "bicycle" - they 
>> both have no numeric value, so it's the same as comparing NIL and 
>> NIL with "i;octet".
> 
> Or as comparing null with null in SQL.
> 
>> Equally, "2" has a numeric value of 2, whereas "fish" does not, so 
>> they are unequal - like comparing NIL and an existing string with 
>> "i;octet".
> 
> Or as comparing 2 with null in SQL. And wouldn't you know, SQL is 
> different from ACAP in this respect.

Good for SQL... ACAP's definitions regarding this are a lot less 
clear.


> I'd rather not venture into this dark and confusing maze of 
> null/nil semantics. These are choices for the protocol to make, say 
> I.
> 
> 
I think - but I'm not absolutely sure - that the question has already 
been settled.

In RFC2244, section 3.4, which is the authoritative definition of 
comparators:

1) "i;octet" specifically states that NIL is equal only to itself. 
(Second paragraph in its definition, last sentence)

2) "i;ascii-casemap" specifically states that it applies a mapping 
then does "i;octet". So NIL==NIL again.

3) "i;ascii-numeric" then complicates my argument, because "All 
values which do not begin with a US-ASCII digit are considered equal 
with an ordinal value higher than all non-NIL single-valued 
attributes" - that certainly seems to mean "fish" == "bicycle", but 
I'm not sure if it means "fish" != NIL or "fish" == NIL. It says 
nothing to me about whether NIL == NIL.


> Instead, I think I'll add a fourth operator, valid, which indicates 
> whether a given string is valid input for the collation. It's not 
> really necessary. indomain(a) is true if and only if a=a. But it 
> sounds sensible. Permits protocols to differentiate between one and 
> two invalid inputs if they want to, without resorting to hacks like 
> a=a.

I'm entirely happy to have an additional operator, however, I'd 
prefer to standardize the behaviour somewhat. In particular, I'd 
quite like it settled as to whether NIL==NIL in general, and whether 
invalid input is equal to NIL - at the very least as a default.

Dave.
-- 
           You see things; and you say "Why?"
   But I dream things that never were; and I say "Why not?"
    - George Bernard Shaw