procedures in the environment abstraction.
#| -*-Scheme-*-
-$Id: disload.scm,v 1.9 2001/08/09 03:06:55 cph Exp $
+$Id: disload.scm,v 1.10 2001/12/19 01:49:45 cph Exp $
Copyright (c) 1993, 1999, 2001 Massachusetts Institute of Technology
(link-variables disenv name compinfo name))
(if (not (environment-bound? parenv 'addressing-granularity))
- (local-assignment
+ (environment-define
parenv
'addressing-granularity
(if (default-object? addressing-granularity)
;;; -*-Scheme-*-
;;;
-;;;$Id: autold.scm,v 1.60 2001/12/18 22:17:19 cph Exp $
+;;;$Id: autold.scm,v 1.61 2001/12/19 01:45:49 cph Exp $
;;;
;;; Copyright (c) 1986, 1989-2001 Massachusetts Institute of Technology
;;;
(define (define-autoload-procedure name package library-name)
(let ((environment (->environment package)))
- (local-assignment environment
- name
- (make-autoloading-procedure
- library-name
- (lambda () (lexical-reference environment name))))))
+ (environment-define environment
+ name
+ (make-autoloading-procedure
+ library-name
+ (lambda () (environment-lookup environment name))))))
(define (define-autoload-major-mode name super-mode-name display-name
library-name description)
(make-autoloading-procedure library-name
(lambda ()
(mode-initialization mode)))))
- (local-assignment (->environment '(EDWIN))
- (mode-name->scheme-name name)
- mode)
+ (environment-define (->environment '(EDWIN))
+ (mode-name->scheme-name name)
+ mode)
name)
(define (define-autoload-minor-mode name display-name library-name description)
(make-autoloading-procedure library-name
(lambda ()
(mode-initialization mode)))))
- (local-assignment (->environment '(EDWIN))
- (mode-name->scheme-name name)
- mode)
+ (environment-define (->environment '(EDWIN))
+ (mode-name->scheme-name name)
+ mode)
name)
(define (autoloading-mode? mode)
(make-autoloading-procedure library-name
(lambda ()
(command-procedure command)))))
- (local-assignment (->environment '(EDWIN))
- (command-name->scheme-name name)
- command)
+ (environment-define (->environment '(EDWIN))
+ (command-name->scheme-name name)
+ command)
name)
(define (autoloading-command? command)
;;; -*-Scheme-*-
;;;
-;;; $Id: debug.scm,v 1.56 2001/03/21 19:25:22 cph Exp $
+;;; $Id: debug.scm,v 1.57 2001/12/19 01:45:58 cph Exp $
;;;
;;; Copyright (c) 1992-2001 Massachusetts Institute of Technology
;;;
(debugger-newline port)
(for-each (lambda (name)
(myprint-binding name
- (environment-lookup environment name)
+ (safe-lookup environment name)
port))
names))))
(cond ((null? names)
(write-string " has no bindings" port))
((and package
- (let ((limit
- (ref-variable
- environment-package-limit)))
+ (let ((limit (ref-variable environment-package-limit)))
(and limit
(let ((n (length names)))
(and (>= n limit)
(write-string
"---------------------------------------------------------------------"
port))
+
+(define (safe-lookup environment name)
+ (if (environment-assigned? environment name)
+ (environment-lookup environment name)
+ (make-unassigned-reference-trap)))
\f
;;;This does some stuff who's end product is to pp the bindings
(define (myprint-binding name value port)
(if (environment-bound? env name)
(print-binding-with-ind
name
- (environment-lookup env name)
+ (safe-lookup env name)
" "
port)
(loop (environment-parent env)))))
(for-each (lambda (name)
(print-binding-with-ind
name
- (environment-lookup environment name)
+ (safe-lookup environment name)
ind
port))
names))))
;;; -*-Scheme-*-
;;;
-;;; $Id: evlcom.scm,v 1.63 2000/03/23 03:19:09 cph Exp $
+;;; $Id: evlcom.scm,v 1.64 2001/12/19 01:46:03 cph Exp $
;;;
-;;; Copyright (c) 1986, 1989-2000 Massachusetts Institute of Technology
+;;; Copyright (c) 1986, 1989-2001 Massachusetts Institute of Technology
;;;
;;; This program is free software; you can redistribute it and/or
;;; modify it under the terms of the GNU General Public License as
;;;
;;; You should have received a copy of the GNU General Public License
;;; along with this program; if not, write to the Free Software
-;;; Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+;;; Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+;;; 02111-1307, USA.
;;;; Evaluation Commands
;;; Package: (edwin)
((syntax-table? syntax-table)
syntax-table)
((symbol? syntax-table)
- (or (and (not (lexical-unreferenceable? environment syntax-table))
+ (or (and (environment-bound? environment syntax-table)
+ (environment-assigned? environment syntax-table)
(let ((syntax-table
- (lexical-reference environment syntax-table)))
+ (environment-lookup environment syntax-table)))
(and (syntax-table? syntax-table)
syntax-table)))
- (editor-error "Undefined syntax table: " syntax-table)))
+ (editor-error "Undefined syntax table" syntax-table)))
(else
- (editor-error "Illegal syntax table: " syntax-table)))))
+ (editor-error "Illegal syntax table" syntax-table)))))
\f
(define-variable run-light
"Scheme run light. Not intended to be modified by users.
;;; -*-Scheme-*-
;;;
-;;; $Id: macros.scm,v 1.66 2001/12/18 21:35:11 cph Exp $
+;;; $Id: macros.scm,v 1.67 2001/12/19 01:46:08 cph Exp $
;;;
;;; Copyright (c) 1986, 1989-1999 Massachusetts Institute of Technology
;;;
(syntax-table/define edwin-environment 'COMMAND-DEFINED?
(lambda (name)
(let ((variable-name (command-name->scheme-name (canonicalize-name name))))
- `(let ((env (->environment '(EDWIN))))
- (and (environment-bound? env ',variable-name)
- (not (lexical-unassigned? env
- ',variable-name)))))))
+ `(LET ((_ENV (->ENVIRONMENT '(EDWIN))))
+ (AND (ENVIRONMENT-BOUND? _ENV ',variable-name)
+ (ENVIRONMENT-ASSIGNED? _ENV ',variable-name))))))
(define (command-name->scheme-name name)
(symbol-append 'EDWIN-COMMAND$ name))
(package/add-child! (find-package '()) 'SWAT swat-env)
(for-each (lambda (export)
- (local-assignment swat-env export 'UNASSIGNED)
+ (environment-define swat-env export 'UNASSIGNED)
(link-variables (package/environment (find-package '())) export
swat-env export))
;; All of SWAT's exported names. This list need pruning
;;; -*-Scheme-*-
;;;
-;;; $Id: compile.scm,v 1.7 2001/11/09 21:37:10 cph Exp $
+;;; $Id: compile.scm,v 1.8 2001/12/19 01:48:38 cph Exp $
;;;
;;; Copyright (c) 2001 Massachusetts Institute of Technology
;;;
(load-option 'SOS)
(if (not (environment-bound? system-global-environment 'XML-PARSER-MACROS))
- (local-assignment system-global-environment
- 'XML-PARSER-MACROS
- (make-parser-macros #f)))
+ (environment-define system-global-environment
+ 'XML-PARSER-MACROS
+ (make-parser-macros #f)))
(with-working-directory-pathname (directory-pathname (current-load-pathname))
(lambda ()