Don't allow MAKE-CONDITIONAL to accept two arguments; require three.
authorChris Hanson <org/chris-hanson/cph>
Tue, 9 Jan 2007 06:37:50 +0000 (06:37 +0000)
committerChris Hanson <org/chris-hanson/cph>
Tue, 9 Jan 2007 06:37:50 +0000 (06:37 +0000)
Otherwise, programs of the form (IF <a> <b> #!DEFAULT) miscompile.

v7/src/runtime/scomb.scm

index 275b7a97737763a208ea70176ec32c9310cd36af..87188c214f40bb138170c966ee40fb380c85cd9e 100644 (file)
@@ -1,6 +1,6 @@
 #| -*-Scheme-*-
 
-$Id: scomb.scm,v 14.26 2007/01/05 21:19:28 cph Exp $
+$Id: scomb.scm,v 14.27 2007/01/09 06:37:50 cph Exp $
 
 Copyright (C) 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994,
     1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
@@ -173,20 +173,16 @@ USA.
 \f
 ;;;; Conditional
 
-(define (make-conditional predicate consequent #!optional alternative)
-  (let ((alternative
-        (if (default-object? alternative)
-            undefined-conditional-branch
-            alternative)))
-    (if (and (combination? predicate)
-            (eq? (combination-operator predicate) (ucode-primitive not)))
-       (make-conditional (car (combination-operands predicate))
-                         alternative
-                         consequent)
-       (&typed-triple-cons (ucode-type conditional)
-                           predicate
-                           consequent
-                           alternative))))
+(define (make-conditional predicate consequent alternative)
+  (if (and (combination? predicate)
+          (eq? (combination-operator predicate) (ucode-primitive not)))
+      (make-conditional (car (combination-operands predicate))
+                       alternative
+                       consequent)
+      (&typed-triple-cons (ucode-type conditional)
+                         predicate
+                         consequent
+                         alternative)))
 
 (define (conditional? object)
   (object-type? (ucode-type conditional) object))