(classifier->runtime
(lambda (form senv hist)
(syntax-check '(_ * (identifier * datum)) form)
- (decl-item
- (lambda ()
- (classify-decls (cdr form) senv (hist-cdr hist)))))))
+ (decl-item (lambda () (classify-decls (cdr form) senv (hist-cdr hist)))))))
(define (classify-decls decls senv hist)
(map (lambda (decl hist)
(%defn-item id value #f))
(define (defn-item-value? object)
- (not (or (reserved-name-item? object)
- (decl-item? object))))
+ (not (reserved-name-item? object)))
(register-predicate! defn-item-value? 'defn-item-value)
(define-record-type <defn-item>
(expr-item compiler)
expr-item?
(compiler expr-item-compiler))
-
-;;; Declaration items represent block-scoped declarations that are to
-;;; be passed through to the compiler.
-
-(define-record-type <decl-item>
- (decl-item text-getter)
- decl-item?
- (text-getter decl-item-text-getter))
-
-(define (decl-item-text item)
- ((decl-item-text-getter item)))
\f
;;;; Specific expression items
(lambda ()
(output/disjunction (map compile-expr-item items)))))
+(define (decl-item classify)
+ (expr-item
+ (lambda ()
+ (output/declaration (classify)))))
+
(define (the-environment-item)
(expr-item output/the-environment))
(lambda (item)
(output/sequence (map compile-expr-item (seq-item-elements item)))))
-(define-item-compiler decl-item?
- (lambda (item)
- (output/declaration (decl-item-text item))))
-
(define-item-compiler defn-item?
(lambda (item)
(if (defn-item? item)