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

Re: mostly open issues, short cutting expressions

1998-11-17 15:55:35
At 12:36 AM 11/18/98 +0300, Alexey Melnikov wrote:
Okay, scripts can't currently take advantage of short-circuit
evaluation.

If an extension exists that makes it possible to use short-circuit
evaluation, could we have that extension change this assumption?

I think yes. Why not?

Well, one example of why not would be the following example:

if( check1 AND check2 ) {

(just to use some logical components that people are somewhat
familiar with, excuse the non-SIEVE grammar, dont have the spec
near me at the moment)

If a given UI understands that shortcutting is supported, then all
is moot.  If a given script parser/evaulator does not support it, then
all is moot.  What is left is the case of a p/e that supports it through
a given extension (or for that matter, a set of extensions that all
require it), and a UI that doesnt understand shortcutting, or at least
when the p/e will use it.

If all check1 and check2 ever are are comparisons (is a message
greater than X bytes and not from someone on my personal list), then
there is no problem.

The problem occurs if a subsequent extension to SIEVE would allow for
a comparison operation to modify something as a result.  An example would
be:

if( check1 AND keyring( "foobar" )) {

in this case, I am constructing a mythical extenstion called keyring that
allows the script to check to see if it is a PGP signed message, and if
it isnt on my personal keyring, to add it to a keyring "foobar" for
later inspection.

In this case, it is important to know if shortcutting is in place, as
if it is, keyring will never be executed if check1 is FALSE.  If we
always want keyring to be evaluated, we would have to put it first if
shortcutting is in place. Otherwise, if shortcutting is not in place,
we know everything will be evaluated, and in this case, any storage
actions of keyring will be performed.

Now, I have given a possible case "keyring" of something that checks for
PGP signed messages and keeps them on an arbitrary keyring (for later
inspection) if not already on a keyring.  This is something I would
myself consider possible and probable.

Are there other cases of extensions people are thinking of where part
of an expression may have an action taking place within it that
shortcutting evaluation would have an impact on?

regards,
Jack
-------------------------------------------------
Jack De Winter - Wildbear Consulting, Inc.
(519) 884-4498          http://www.wildbear.on.ca/homepages/jack/

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