Subject: sieve & short-circuit evaluation

From: Tim Showalter <[email-masked]>
Date: 7 Dec 1998 19:37:00 -0500

Today a bunch of us got together by the pool to discuss whether or not
Sieve should have short-circut evalation.  After some arguing, we
concluded that it shouldn't, and that extensions that made use of it
were just a bad idea.

One note, though.  While I still believe this is the right conclusion,
this is the mechanism that some languages (C, LISP) use to return an
exceptional condition (disk full, network exploded, etc.).

This means that if we get a complex extension that can fail when it is
run AND we have enough of a language for a fallback condition, we'll
have to provide a way to handle what amounts to an exception.

I'll have real notes from the meeting posted soon.

Tim

-- 
Tim Showalter <[email-masked]>

---

From: Tony Hansen <[email-masked]>
Date: Tue, 08 Dec 1998 01:42:13 -0500

> have to provide a way to handle what amounts to an exception.

I may be stating the obvious here, but don't forget that short circuit
conditionals can always be rewritten using nested if statements. It's a
straight forward conversion. Unfortunately, else clauses after such a
conditional need to be duplicated to get equivalent functionality:

This:
    if extension_that_can_fail() && something_else() {
        # this requires short circuit evaluation
    }
becomes:
    if extension_that_can_fail() {
        if something_else() {
            # nested if is equivalent to short circuit evaluation
        }
    }

And this:
    if extension_that_can_fail() && something_else() {
        # this requires short circuit evaluation
    }else {
       some_more_code();
    }
becomes:
    if extension_that_can_fail() {
        if something_else() {
            # nested if is equivalent to short circuit evaluation
        }else {
           some_more_code();
        }
    }else {
       some_more_code();
   }

    Tony Hansen
    [email-masked]

---

From: Tim Showalter <[email-masked]>
Date: 8 Dec 1998 10:01:39 -0500

> Date: Tue, 08 Dec 1998 01:42:13 -0500
> From: Tony Hansen <[email-masked]>

> conditionals can always be rewritten using nested if statements.

Okay, good point.  Thank you.

Tim