\f
(define with-instance-variables
(make-unmapped-macro-reference-trap
- (compiler-item
- (lambda (form environment . rest)
+ (classifier-item
+ ;; Rest arg facilitates cross-compiling from 9.2.
+ ;; It should be removed after 9.3 release.
+ (lambda (form senv . rest)
(syntax-check '(_ identifier expression (* identifier) + expression) form)
(let ((class-name (cadr form))
- (self (caddr form))
+ (self-item (apply classify-form (caddr form) senv rest))
(free-names (cadddr form))
- (body (cddddr form)))
- (transform-instance-variables
- (class-instance-transforms
- (name->class (identifier->symbol class-name)))
- (compile-expr-item (apply classify-form self environment rest))
- free-names
- (compile-expr-item
- (apply classify-form
- `(,(close-syntax 'begin
- (runtime-environment->syntactic
- system-global-environment))
- ,@body)
- environment
- rest))))))))
+ (body-item
+ (apply classify-form
+ `(,(close-syntax 'begin
+ (runtime-environment->syntactic
+ system-global-environment))
+ ,@(cddddr form))
+ senv
+ rest)))
+ (expr-item
+ (lambda ()
+ (transform-instance-variables
+ (class-instance-transforms
+ (name->class (identifier->symbol class-name)))
+ (compile-expr-item self-item)
+ free-names
+ (compile-expr-item body-item)))))))))
(define-syntax ==>
(syntax-rules ()
usual==>
with-instance-variables)
(import (runtime syntax)
+ classifier-item
classify-form
compile-expr-item
- compiler-item))
+ expr-item))
(define-package (edwin class-macros transform-instance-variables)
(files "xform")
env 'microcode-type))))
(let ((env (->environment '(runtime syntax))))
- (provide-rename env 'make-compiler-item 'compiler-item)
+ (provide-rename env 'make-classifier-item 'classifier-item)
+ (provide-rename env 'make-expression-item 'expr-item)
(provide-rename env 'compile-item/expression 'compile-expr-item)
(if (unbound? env 'classify-form)
- (eval '(define (classify-form form env)
- (classify/form form env env))
+ (eval '(define (classify-form form senv #!optional hist)
+ (classify/form form senv senv))
env)))
(let ((env (->environment '(package))))
classifier-item
classifier-item-impl
classifier-item?
- compiler-item
- compiler-item-impl
- compiler-item?
combination-item
constant-item
decl-item
classifier-item?
(impl classifier-item-impl))
-(define-record-type <compiler-item>
- (compiler-item impl)
- compiler-item?
- (impl compiler-item-impl))
-
(define-record-type <expander-item>
(expander-item impl expr)
expander-item?
(define (keyword-item? object)
(or (classifier-item? object)
- (compiler-item? object)
(expander-item? object)))
(register-predicate! keyword-item? 'keyword-item)
(set-predicate<=! classifier-item? keyword-item?)
-(set-predicate<=! compiler-item? keyword-item?)
(set-predicate<=! expander-item? keyword-item?)
;;; Variable items represent run-time variables.
(let ((item (classify-form-car form senv hist)))
(cond ((classifier-item? item)
((classifier-item-impl item) form senv hist))
- ((compiler-item? item)
- (expr-item
- (let ((compiler (compiler-item-impl item)))
- (lambda ()
- (compiler form senv hist)))))
((expander-item? item)
(reclassify ((expander-item-impl item) form senv)
senv