#| -*-Scheme-*-
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/runtime/dbgutl.scm,v 14.2 1988/06/13 11:43:10 cph Exp $
+$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/runtime/dbgutl.scm,v 14.3 1988/08/01 23:09:37 cph Exp $
Copyright (c) 1988 Massachusetts Institute of Technology
(define rename-list)
\f
(define (show-frame frame depth)
- (if (eq? system-global-environment frame)
+ (if (system-global-environment? frame)
(begin
(newline)
(write-string "This frame is the system global environment"))
#| -*-Scheme-*-
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/runtime/debug.scm,v 14.3 1988/07/14 07:39:50 cph Exp $
+$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/runtime/debug.scm,v 14.4 1988/08/01 23:08:34 cph Exp $
Copyright (c) 1988 Massachusetts Institute of Technology
;;; procedure name
(write-string
(string-pad-right
- (if (or (not (environment? environment))
+ (if (or (not (ic-environment? environment))
(special-name? (environment-name environment)))
""
(write-to-truncated-string (environment-name environment) 20))
(define (if-valid-environment environment receiver)
(cond ((debugging-info/undefined-environment? environment)
(print-undefined-environment))
- ((eq? environment system-global-environment)
+ ((system-global-environment? environment)
(newline)
(write-string
"System global environment at this subproblem/reduction level"))
#| -*-Scheme-*-
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/runtime/rep.scm,v 14.4 1988/07/14 07:40:37 cph Exp $
+$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/runtime/rep.scm,v 14.5 1988/08/01 23:09:21 cph Exp $
Copyright (c) 1988 Massachusetts Institute of Technology
environment))
(define (->environment object)
- (cond ((or (eq? object system-global-environment)
- (environment? object))
+ (cond ((environment? object)
object)
((compound-procedure? object) (procedure-environment object))
((promise? object)
#| -*-Scheme-*-
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/runtime/runtime.pkg,v 14.16 1988/07/19 20:42:58 cph Exp $
+$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/runtime/runtime.pkg,v 14.17 1988/08/01 23:09:01 cph Exp $
Copyright (c) 1988 Massachusetts Institute of Technology
environment-parent
environment-procedure
environment?
+ ic-environment?
remove-environment-parent!
- set-environment-parent!))
+ set-environment-parent!
+ system-global-environment?))
(define-package (runtime environment-inspector)
(files "where")
#| -*-Scheme-*-
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/runtime/scode.scm,v 14.2 1988/06/16 06:29:20 cph Exp $
+$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/runtime/scode.scm,v 14.3 1988/08/01 23:10:12 cph Exp $
Copyright (c) 1988 Massachusetts Institute of Technology
(define (absolute-reference? object)
(and (access? object)
- (eq? (access-environment object) system-global-environment)))
+ (system-global-environment? (access-environment object))))
(define-integrable (absolute-reference-name reference)
(access-name reference))
#| -*-Scheme-*-
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/runtime/uenvir.scm,v 14.2 1988/06/13 11:58:33 cph Exp $
+$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/runtime/uenvir.scm,v 14.3 1988/08/01 23:08:20 cph Exp $
Copyright (c) 1988 Massachusetts Institute of Technology
\f
;;;; Environment
-(define-integrable (environment? object)
+(define (environment? object)
+ (if (system-global-environment? object)
+ true
+ (ic-environment? object)))
+
+(define-integrable (system-global-environment? object)
+ (eq? system-global-environment object))
+
+(define-integrable (ic-environment? object)
(object-type? (ucode-type environment) object))
(define (environment-procedure environment)
(select-procedure (environment->external environment)))
(define (environment-has-parent? environment)
- (not (eq? (select-parent (environment->external environment))
- null-environment)))
+ (and (ic-environment? environment)
+ (not (eq? (select-parent (environment->external environment))
+ null-environment))))
(define (environment-parent environment)
(select-parent (environment->external environment)))
#| -*-Scheme-*-
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/runtime/where.scm,v 14.2 1988/07/14 07:41:03 cph Exp $
+$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/runtime/where.scm,v 14.3 1988/08/01 23:09:58 cph Exp $
Copyright (c) 1988 Massachusetts Institute of Technology
(show-frame current-frame current-frame-depth))
(define (show-all)
- (let s1 ((env env)
- (depth 0))
- (if (eq? system-global-environment env)
- *the-non-printing-object*
+ (let s1 ((env env) (depth 0))
+ (if (not (system-global-environment? env))
(begin (show-frame env depth)
(if (environment-has-parent? env)
- (s1 (environment-parent env) (1+ depth))
- *the-non-printing-object*)))))
-\f
+ (s1 (environment-parent env) (1+ depth))))))
+ *the-non-printing-object*)
+
;;;; Motion Commands
(define (parent)
- (cond ((eq? system-global-environment current-frame)
- (newline)
- (write-string
-"The current frame is the system global environment, it has no parent."))
- ((environment-has-parent? current-frame)
+ (cond ((environment-has-parent? current-frame)
(set! current-frame (environment-parent current-frame))
(set! current-frame-depth (1+ current-frame-depth))
(show))
#| -*-Scheme-*-
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v8/src/runtime/dbgutl.scm,v 14.2 1988/06/13 11:43:10 cph Exp $
+$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v8/src/runtime/dbgutl.scm,v 14.3 1988/08/01 23:09:37 cph Exp $
Copyright (c) 1988 Massachusetts Institute of Technology
(define rename-list)
\f
(define (show-frame frame depth)
- (if (eq? system-global-environment frame)
+ (if (system-global-environment? frame)
(begin
(newline)
(write-string "This frame is the system global environment"))
#| -*-Scheme-*-
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v8/src/runtime/runtime.pkg,v 14.16 1988/07/19 20:42:58 cph Exp $
+$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v8/src/runtime/runtime.pkg,v 14.17 1988/08/01 23:09:01 cph Exp $
Copyright (c) 1988 Massachusetts Institute of Technology
environment-parent
environment-procedure
environment?
+ ic-environment?
remove-environment-parent!
- set-environment-parent!))
+ set-environment-parent!
+ system-global-environment?))
(define-package (runtime environment-inspector)
(files "where")
#| -*-Scheme-*-
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v8/src/runtime/uenvir.scm,v 14.2 1988/06/13 11:58:33 cph Exp $
+$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v8/src/runtime/uenvir.scm,v 14.3 1988/08/01 23:08:20 cph Exp $
Copyright (c) 1988 Massachusetts Institute of Technology
\f
;;;; Environment
-(define-integrable (environment? object)
+(define (environment? object)
+ (if (system-global-environment? object)
+ true
+ (ic-environment? object)))
+
+(define-integrable (system-global-environment? object)
+ (eq? system-global-environment object))
+
+(define-integrable (ic-environment? object)
(object-type? (ucode-type environment) object))
(define (environment-procedure environment)
(select-procedure (environment->external environment)))
(define (environment-has-parent? environment)
- (not (eq? (select-parent (environment->external environment))
- null-environment)))
+ (and (ic-environment? environment)
+ (not (eq? (select-parent (environment->external environment))
+ null-environment))))
(define (environment-parent environment)
(select-parent (environment->external environment)))