Fix bugs in condition/environment and condition/substitute-environment?
authorGuillermo J. Rozas <edu/mit/csail/zurich/gjr>
Thu, 4 May 1989 19:45:56 +0000 (19:45 +0000)
committerGuillermo J. Rozas <edu/mit/csail/zurich/gjr>
Thu, 4 May 1989 19:45:56 +0000 (19:45 +0000)
v7/src/runtime/error.scm

index 81f8fa25f60f55f223f98f7366c734f5e2f7498d..5d1754a84326f922808fd525bc8666d74512b70a 100644 (file)
@@ -1,6 +1,6 @@
 #| -*-Scheme-*-
 
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/runtime/error.scm,v 14.7 1989/03/29 02:45:28 jinx Exp $
+$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/runtime/error.scm,v 14.8 1989/05/04 19:45:56 jinx Exp $
 
 Copyright (c) 1988, 1989 Massachusetts Institute of Technology
 
@@ -160,11 +160,21 @@ MIT in each case. |#
                    message-tag
                    "Anonymous error")))
 
-(define-integrable (condition/environment condition)
-  (car (1d-table/get (condition/properties condition) environment-tag false)))
-
-(define-integrable (condition/substitute-environment? condition)
-  (cdr (1d-table/get (condition/properties condition) environment-tag false)))
+(define default-condition-environment
+  (cons false false))
+
+(define (condition/environment condition)
+  (let ((place (1d-table/get (condition/properties condition)
+                            environment-tag false)))
+    (if (not place)
+       (nearest-repl/environment)
+       (car place))))
+
+(define (condition/substitute-environment? condition)
+  (let ((place (1d-table/get (condition/properties condition)
+                            environment-tag false)))
+    (or (not place)
+       (cdr place))))
 \f
 ;;;; Standard Error Handler