From: Clive D.W. Feather (clive@demon.net)
Date: Mon Feb 04 2002 - 03:53:24 CST
[Reordered for reasons which should become clear.]
Bill Davidsen said:
>> Also, in the latest NNTP draft, there is provision for wildmats such as
>> de.*,!de.binaries.*
>> where, after much discussion, we arrived at the rule:
>> "start from the right hand end and find the first wildmat component
>> that matches the target. If it is a negative component, the match
>> fails; if it is positive the match succeeds."
>
> This seems to preclude my example above, and I don't believe that's
> intended behaviour, is it?
Yes, it is.
> It would prevent rules like "all this
> hierarchy except this branch but including this twig on that branch"
> which are real-life useful.
No, it doesn't. To explain how it would work with the examples in your
message:
>> Distribution: foo, !bar, baz
Matches foo bar baz
Yes Yes *Yes Accept
Yes *Yes No Reject
Yes No *Yes Accept
*Yes No No Accept
No Yes *Yes Accept
No *Yes No Reject
No No *Yes Accept
No No No Reject (default)
(* indicates the rightmost match).
>> (so Distribution: foo, !foo would be rejected everywhere).
Correct, but "Distribution: !foo, foo" would be accepted everywhere.
>> the form "all,!foo".
Assuming "all" is a wildcard, then this rejects "foo" and accepts
everything else.
>> Control: checkgroups de, !de.binaries
This would accept all of "de" except "de.binaries".
> I don't see that "de, !de" differs from your "foo,!foo" above. But to be
> useful the list MUST be parsed left to right. Therefore:
> de,!de.sex,de.sex.mod all of de, except de.sex and including de.sex.mod
> !de.binaries,de I would suspect this means all of de, at
> least to me.
In both cases this is what the "right to left" test would yield.
> I don't see the semantics of "start at the left, apply each portion, if
> it applies set the pass/fail state."
I wonder if you are, perhaps, misunderstanding the rule.
The "rightmost match" rule does precisely that, looks at the rightmost
match. Apart from anything else, it means you can always stop at the first
match.
In nearly every circumstance it will do what you think it will. For
example:
de,!de.sex,de.sex.mod
will work as follows:
de.sex.mod: matches de.sex.mod, therefore passes
rest of de.sex: fails de.sex.mod, matches !de.sex, therefore fails
rest of de: fails de.sex.mod, fails !de.sex, matches de, therefore
passes
That's almost certainly what you *want* the string to mean.
I forget why we worded it this way, rather than left to right. I suspect it
just made the semantics easier to describe, but there may have been a
pathological case.
Can you give *exact* algorithmic semantics for how you think these things
work ? If so, I'll do a comparison for you.
-- Clive D.W. Feather | Work: <clive@demon.net> | Tel: +44 20 8371 1138 Internet Expert | Home: <clive@davros.org> | Fax: +44 870 051 9937 Demon Internet | WWW: http://www.davros.org | Mobile: +44 7973 377646 Thus plc | | NOTE: fax number change