[Top] [All Lists]

evaluating tests when the result makes no sense

2008-11-27 08:02:13


Are implementations permitted to stop evaluating a test, when the result makes no sense, e.g. in anyof(true, header "A" "B") evaluate "header"?

The point is, that Sieve-Variables, says (Sec. 3.2. Match Variables)

   The decimal value of the match variable name will index the list of
   matching strings from the most recently evaluated successful match of
   type ":matches".

However it is not very clear for me if every test needs to be evaluated, and thus if the last :match test was permitted to be evaluated, is it necessary to evaluate it? Consider a message

A: Xa
B: Xb
C: Mc

if anyof (header :matches ["A", "B"] "X*",
          header :matches "C" "M*") {
    //what is ${1}?

What would be the value of ${1}
* a - because after finding it out, the result of the first header test is clear. Having true as the first parameter of anyof, then anyof stops evaluation. * c - because this is the last matched test and the evaluation has not stopped after finding out that the first header test suffices for the result of anyof * b - header evaluates all possibilities, and anyof stops when the result is clear.

Thanks in advance for your opinion,

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