#| -*-Scheme-*-
-$Id: runtime.pkg,v 14.387 2001/12/18 20:51:05 cph Exp $
+$Id: runtime.pkg,v 14.388 2001/12/19 01:39:36 cph Exp $
Copyright (c) 1988-2001 Massachusetts Institute of Technology
environment-arguments
environment-assign!
environment-assignable?
+ environment-assigned?
environment-bindings
environment-bound-names
environment-bound?
+ environment-define
environment-has-parent?
environment-lambda
environment-lookup
(files "syntab")
(parent (runtime))
(export ()
+ environment-syntax-table
guarantee-syntax-table
make-syntax-table
+ set-environment-syntax-table!
syntax-table-define
syntax-table-ref
syntax-table/copy
syntax-table/extend
syntax-table/parent
syntax-table/ref
- syntax-table?))
+ syntax-table?)
+ (export (runtime environment)
+ syntax-table-tag))
(define-package (runtime syntaxer)
(files "syntax")
(parent (runtime))
(export ()
- environment-syntax-table
hook/syntax-expression
lambda-tag:fluid-let
lambda-tag:let
lambda-tag:make-environment
lambda-tag:unnamed
make-syntax-closure
- set-environment-syntax-table!
syntax
syntax*
syntax-closure/expression
user-initial-syntax-table)
(export (runtime defstruct)
parse-lambda-list)
- (export (runtime environment)
- syntax-table-tag)
(initialization (initialize-package!)))
(define-package (runtime illegal-definitions)
#| -*-Scheme-*-
-$Id: syntab.scm,v 14.6 2001/12/18 20:47:46 cph Exp $
+$Id: syntab.scm,v 14.7 2001/12/19 01:39:41 cph Exp $
Copyright (c) 1988-1999, 2001 Massachusetts Institute of Technology
(define (syntax-table/extend table alist)
(%make-syntax-table (alist-copy alist)
- (guarantee-syntax-table table 'SYNTAX-TABLE/EXTEND)))
\ No newline at end of file
+ (guarantee-syntax-table table 'SYNTAX-TABLE/EXTEND)))
+
+(define (environment-syntax-table environment)
+ (environment-lookup environment syntax-table-tag))
+
+(define (set-environment-syntax-table! environment table)
+ (environment-define environment
+ syntax-table-tag
+ (guarantee-syntax-table table
+ 'SET-ENVIRONMENT-SYNTAX-TABLE!)))
+
+(define-integrable syntax-table-tag
+ ((ucode-primitive string->symbol)
+ "#[(runtime syntax-table)syntax-table-tag]"))
\ No newline at end of file
#| -*-Scheme-*-
-$Id: syntax.scm,v 14.35 2001/12/18 20:47:18 cph Exp $
+$Id: syntax.scm,v 14.36 2001/12/19 01:39:46 cph Exp $
Copyright (c) 1988-2001 Massachusetts Institute of Technology
(define (syntax/top-level?)
*syntax-top-level?*)
-(define (environment-syntax-table environment)
- (environment-lookup environment syntax-table-tag))
-
-(define (set-environment-syntax-table! environment table)
- (if (not (interpreter-environment? environment))
- (error:wrong-type-argument environment
- "interpreter environment"
- 'SET-ENVIRONMENT-SYNTAX-TABLE!))
- (local-assignment environment syntax-table-tag table))
-
-(define-integrable syntax-table-tag
- ((ucode-primitive string->symbol)
- "#[(runtime syntax-table)syntax-table-tag]"))
-\f
(define-integrable (syntax-subsequence expressions)
(syntax-sequence #f expressions))
#| -*-Scheme-*-
-$Id: uenvir.scm,v 14.45 2001/12/18 20:50:59 cph Exp $
+$Id: uenvir.scm,v 14.46 2001/12/19 01:39:52 cph Exp $
Copyright (c) 1988-1999, 2001 Massachusetts Institute of Technology
(else
(illegal-environment environment 'ENVIRONMENT-BOUND?))))
+(define (environment-assigned? environment name)
+ (cond ((interpreter-environment? environment)
+ (interpreter-environment/assigned? environment name))
+ ((stack-ccenv? environment)
+ (stack-ccenv/assigned? environment name))
+ ((closure-ccenv? environment)
+ (closure-ccenv/assigned? environment name))
+ (else
+ (illegal-environment environment 'ENVIRONMENT-ASSIGNED?))))
+
(define (environment-lookup environment name)
(cond ((interpreter-environment? environment)
(interpreter-environment/lookup environment name))
(else
(illegal-environment environment 'ENVIRONMENT-ASSIGN!))))
+(define (environment-define environment name value)
+ (cond ((interpreter-environment? environment)
+ (interpreter-environment/define environment name value))
+ ((or (stack-ccenv? environment)
+ (closure-ccenv? environment))
+ (error:bad-range-argument environment 'ENVIRONMENT-DEFINE))
+ (else
+ (illegal-environment environment 'ENVIRONMENT-DEFINE))))
+
(define (illegal-environment object procedure)
(error:wrong-type-argument object "environment" procedure))
\f
(define (interpreter-environment/bound? environment name)
(not (lexical-unbound? environment name)))
+(define (interpreter-environment/assigned? environment name)
+ (not (lexical-unassigned? environment name)))
+
(define (interpreter-environment/lookup environment name)
- (if (lexical-unassigned? environment name)
- (make-unassigned-reference-trap)
- (lexical-reference environment name)))
+ (lexical-reference environment name))
(define (interpreter-environment/assign! environment name value)
(lexical-assignment environment name value)
unspecific)
+(define (interpreter-environment/define environment name value)
+ (local-assignment environment name value)
+ unspecific)
+
(define (ic-environment/bound-names environment)
(map-ic-environment-bindings map-entry/bound-names environment))
(and parent
(environment-bound? parent name)))))
+(define (stack-ccenv/assigned? environment name)
+ (and (stack-ccenv/lookup environment name) #t))
+
(define (stack-ccenv/lookup environment name)
(lookup-dbg-variable (stack-ccenv/block environment)
name
(and parent
(environment-bound? parent name)))))
+(define (closure-ccenv/assigned? environment name)
+ (and (closure-ccenv/lookup environment name) #t))
+
(define (closure-ccenv/variable-bound? environment variable)
(or (eq? (dbg-variable/type variable) 'INTEGRATED)
(vector-find-next-element