(change-type/expression (conditional/alternative expression))))
(define-method/change-type 'CONSTANT
- (lambda (expression)
- expression ; ignored
- 'DONE))
+ false-procedure)
\f
(define-method/change-type 'DECLARATION
(lambda (expression)
(change-type/expression (disjunction/predicate expression))
(change-type/expression (disjunction/alternative expression))))
-(define-method/change-type 'PROCEDURE
- (lambda (expression)
- (change-type/expression (procedure/body expression))))
-
(define-method/change-type 'OPEN-BLOCK
(lambda (expression)
(change-type/expressions (open-block/values expression))
- (change-type/open-block-actions (open-block/actions expression))))
+ (for-each (lambda (action)
+ (if (not (eq? action open-block/value-marker))
+ (change-type/expression action)))
+ (open-block/actions expression))))
-(define (change-type/open-block-actions actions)
- (cond ((null? actions) 'DONE)
- ((eq? (car actions) open-block/value-marker)
- (change-type/open-block-actions (cdr actions)))
- (else (change-type/expression (car actions))
- (change-type/open-block-actions (cdr actions)))))
+(define-method/change-type 'PROCEDURE
+ (lambda (expression)
+ (change-type/expression (procedure/body expression))))
(define-method/change-type 'QUOTATION
(lambda (expression)
- (change-type/quotation expression)))
-
-(define (change-type/quotation quotation)
- (change-type/expression (quotation/expression quotation)))
+ (change-type/expression (quotation/expression expression))))
(define-method/change-type 'REFERENCE
- (lambda (expression)
- expression ; ignored
- 'DONE))
+ false-procedure)
(define-method/change-type 'SEQUENCE
(lambda (expression)
(change-type/expressions (sequence/actions expression))))
(define-method/change-type 'THE-ENVIRONMENT
- (lambda (expression)
- expression ; ignored
- 'DONE))
\ No newline at end of file
+ false-procedure)
\ No newline at end of file
(define copy/declarations)
(define (copy/expression/intern block expression)
+ (guarantee-block block 'copy/expression/intern)
(fluid-let ((root-block block)
(copy/variable/free copy/variable/free/intern)
(copy/declarations copy/declarations/intern))
(copy/expression block (environment/make) expression)))
(define (copy/expression/extern block expression)
+ (guarantee-block block 'copy/expression/extern)
(fluid-let ((root-block block)
(copy/variable/free copy/variable/free/extern)
(copy/declarations copy/declarations/extern))
(map* environment cons variables values))
(define (environment/lookup environment variable if-found if-not)
+ (guarantee-variable variable 'environment/lookup)
(let ((association (assq variable environment)))
(if association
(if-found (cdr association))
(define (make-renamer environment)
(lambda (variable)
+ (guarantee-variable variable)
(environment/lookup environment variable
identity-procedure
(lambda () (error "Variable missing during copy operation:" variable)))))
(values result environment)))))
(define (copy/variable block environment variable)
- block ;ignored
+ (declare (ignore block))
(environment/lookup environment variable
identity-procedure
(lambda () (copy/variable/free variable))))
(block/lookup-name root-block (variable/name variable) true))
(define (copy/declarations/intern block environment declarations)
- block ;ignored
+ (declare (ignore block))
(if (null? declarations)
'()
(declarations/map declarations
(conditional/scode expression)
(copy/expression block environment (conditional/predicate expression))
(copy/expression block environment (conditional/consequent expression))
- (copy/expression block
- environment
- (conditional/alternative expression)))))
+ (copy/expression block environment (conditional/alternative expression)))))
(define-method/copy 'CONSTANT
(lambda (block environment expression)
- block environment ;ignored
+ (declare (ignore block environment))
expression))
(define-method/copy 'DECLARATION
(define-method/copy 'QUOTATION
(lambda (block environment expression)
- block environment ;ignored
+ (declare (ignore block environment))
(copy/quotation expression)))
(define-method/copy 'REFERENCE
(define-method/copy 'THE-ENVIRONMENT
(lambda (block environment expression)
- block environment expression ;ignored
+ (declare (ignore block environment expression))
(error "Attempt to integrate expression containing (THE-ENVIRONMENT)")))
\ No newline at end of file
(integrate-external "object"))
\f
(define (variable/make&bind! block name)
+ (guarantee-symbol name 'variable/make&bind!)
(or (%block/lookup-name block name)
(%variable/make&bind! block name)))
variable))
(define (block/lookup-name block name intern?)
+ (guarantee-symbol name 'block/lookup-name)
(let search ((block block))
(or (%block/lookup-name block name)
(if (block/parent block)
(eq? (variable/name variable) name))))
(define (block/limited-lookup block name limit)
+ (guarantee-symbol name 'block/limited-lookup)
(let search ((block block))
(and (not (eq? block limit))
(or (%block/lookup-name block name)
(define sf:noisy? #t)
(define (sf/set-usual-integrations-default-deletions! del-list)
- (if (not (list-of-symbols? del-list))
- (error "sf/set-usual-integrations-default-deletions!: Bad deletion list"
- del-list))
+ (guarantee-list-of-type del-list symbol? "list of symbols"
+ 'sf/set-usual-integrations-default-deletions!)
(set! sf/usual-integrations-default-deletions del-list)
unspecific)
(define sf/usual-integrations-default-deletions
'())
-
-(define (list-of-symbols? object)
- (or (null? object)
- (and (pair? object)
- (symbol? (car object))
- (list-of-symbols? (cdr object)))))
\f
;;;; File Syntaxer
(define (syntax-file input-string bin-string spec-string)
- (if (not (environment? sf/default-syntax-table))
- (error "Malformed binding of SF/DEFAULT-SYNTAX-TABLE:"
- sf/default-syntax-table))
- (if (not (list-of-symbols? sf/top-level-definitions))
- (error "Malformed binding of SF/TOP-LEVEL-DEFINITIONS:"
- sf/top-level-definitions))
+ (guarantee-environment sf/default-syntax-table 'syntax-file)
+ (guarantee-list-of-type sf/top-level-definitions symbol? 'syntax-file)
(for-each (lambda (input-string)
(receive (input-pathname bin-pathname spec-pathname)
(sf/pathname-defaulting input-string bin-string spec-string)