ietf-mta-filters
[Top] [All Lists]

Alternative definitions for 5.1 (allof) and 5.2 (anyof)

1998-11-12 11:35:09
I would like to propose alternative definitions for the "allof" (Sec 5.1)
and "anyof" (5.2) tests.  The essential difference is to allow the words
"and" and "or" as binary, infix operators for equivalent semantics.

5.1. Test allof / and

   Syntax:   allof ( <test> , <test> , ... <test> )
         or:   <test1> and <test2>

   The allof test preforms a logical AND on the tests supplied to it.  The
tests
   evaluated from left to right, and evaluations of the tests stops on the
first
   test with a "false" result. The allof test takes as its argument a
test-list.

   The "and" operator returns the logical AND of both tests.  <Test1> is
   evaluated first, and only if its result is true then <test2> is
evaluated.
   Multiple occurances of "and" within the same test expression is evaluated
   from left to right.  I.e.:

        <test1> and <test2> and <test3>

   is equivalent to

        (<test1> and <test2>) and <test3>

   Examples:  allof (false, false)  =>   false
              allof (false, true)   =>   false
              allof (true, true)    =>   true

                  exists header ["To"] and exists header ["Cc"]



Similarly, the "anyof" definition should be:

5.2. Test anyof / or

   Syntax:   anyof ( <test> , <test> , ... <test> )
       or:   <test1> or <test2>

   The anyof test preforms a logical OR on the tests supplied to it.  Tests
   are evaluated from left to right, stopping at the first test that results
   in a "true" result.

   The "or" operator returns the logical OR of both tests.  <Test1> is
evaluated
   first, and only if its value is "false", then <test2> is evaluated.
Multiple
   occurances of "or" within the same test expression are evaluated from
left to
   right. I.e.:

        <test1> or <test2> or <test3>

   is equivalent to:

        (<test1> or <test2>) or <test3>

   Examples:  anyof (false, false)  =>   false
              anyof (false, true)   =>   true
              anyof (true, true)    =>   true

                  exists header ["To"] or exists header ["Cc"]
--
Alan K. Stebbens <alan(_dot_)stebbens(_at_)software(_dot_)com>


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