From: Joe Marshall Date: Tue, 2 Mar 2010 22:19:52 +0000 (-0800) Subject: Don't check untaken branches when checking for boolean expression. X-Git-Tag: 20100708-Gtk~135 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=8d1c5a36af7d18fe4c8c1f894ce7fe9c608e3042;p=mit-scheme.git Don't check untaken branches when checking for boolean expression. --- diff --git a/src/sf/object.scm b/src/sf/object.scm index c6155bb54..131863b81 100644 --- a/src/sf/object.scm +++ b/src/sf/object.scm @@ -255,8 +255,10 @@ USA. (cond ((expression/call-to-boolean-predicate? expression)) ((conditional? expression) - (and (expression/boolean? (conditional/consequent expression)) - (expression/boolean? (conditional/alternative expression)))) + (and (or (expression/always-false? (conditional/predicate expression)) + (expression/boolean? (conditional/consequent expression))) + (or (expression/never-false? (conditional/predicate expression)) + (expression/boolean? (conditional/alternative expression))))) ((constant? expression) (or (not (constant/value expression)) @@ -267,7 +269,8 @@ USA. ((disjunction? expression) (and (expression/boolean? (disjunction/predicate expression)) - (expression/boolean? (conditional/alternative expression)))) + (or (expression/never-false? (disjunction/predicate expression)) + (expression/boolean? (conditional/alternative expression))))) ((sequence? expression) (expression/boolean? (last (sequence/actions expression))))