(lambda (form senv hist)
(let* ((body-senv (make-internal-senv senv))
(bindings
- (map (lambda (binding hist)
- (cons (bind-variable (car binding) body-senv)
- (classify-form-cadr binding senv hist)))
- (cadr form)
- (subform-hists (cadr form) (hist-cadr hist)))))
+ (smap (lambda (binding hist)
+ (cons (bind-variable (car binding) body-senv)
+ (classify-form-cadr binding senv hist)))
+ (cadr form)
+ (hist-cadr hist))))
(let-item (map car bindings)
(map cdr bindings)
(body-item
(define (classifier:let-syntax form senv hist)
(syntax-check '(_ (* (identifier expression)) + form) form)
(let ((body-senv (make-internal-senv senv)))
- (for-each (lambda (binding hist)
- (keyword-binder body-senv
- (car binding)
- (classify-form-cadr binding senv hist)))
- (cadr form)
- (subform-hists (cadr form) (hist-cadr hist)))
+ (sfor-each (lambda (binding hist)
+ (keyword-binder body-senv
+ (car binding)
+ (classify-form-cadr binding senv hist)))
+ (cadr form)
+ (hist-cadr hist))
(seq-item
(classify-forms-in-order-cddr form body-senv hist))))
(for-each (lambda (binding item)
(keyword-binder binding-senv (car binding) item))
bindings
- (map (lambda (binding hist)
+ (smap (lambda (binding hist)
(classify-form-cadr binding binding-senv hist))
bindings
- (subform-hists bindings (hist-cadr hist)))))
+ (hist-cadr hist))))
(seq-item
(classify-forms-in-order-cddr form
(make-internal-senv binding-senv)
(classifier->runtime
(lambda (form senv hist)
(syntax-check '(_ * (identifier * datum)) form)
- (decl-item (lambda () (classify-decls (cdr form) senv (hist-cdr hist)))))))
-
-(define (classify-decls decls senv hist)
- (map (lambda (decl hist)
- (classify-decl decl senv hist))
- decls
- (subform-hists decls hist)))
-
-(define (classify-decl decl senv hist)
- (map-decl-ids (lambda (id selector)
- (classify-id id senv (hist-select selector hist)))
- decl))
+ (decl-item
+ (lambda ()
+ (smap (lambda (decl hist)
+ (map-decl-ids (lambda (id selector)
+ (classify-id id
+ senv
+ (hist-select selector hist)))
+ decl))
+ (cdr form)
+ (hist-cdr hist)))))))
(define (classify-id id senv hist)
(let ((item (classify-form id senv hist)))
(classify-form form env (hist-reduce form hist)))
(define (classify-forms forms senv hist)
- (map (lambda (expr hist)
- (classify-form expr senv hist))
- forms
- (subform-hists forms hist)))
+ (smap (lambda (expr hist)
+ (classify-form expr senv hist))
+ forms
+ hist))
(define (classify-forms-cdr form senv hist)
(classify-forms (cdr form) senv (hist-cdr hist)))
(define (classify-forms-in-order forms senv hist)
- (map-in-order (lambda (form hist)
- (classify-form form senv hist))
- forms
- (subform-hists forms hist)))
+ (smap-in-order (lambda (form hist)
+ (classify-form form senv hist))
+ forms
+ hist))
(define (classify-forms-in-order-cdr form senv hist)
(classify-forms-in-order (cdr form) senv (hist-cdr hist)))
(if (pair? (car lists))
(loop (map cdr lists)
(cons (apply procedure (map car lists)) values))
- (reverse! values))))
\ No newline at end of file
+ (reverse! values))))
+
+(define (smap procedure forms hist)
+ (map procedure forms (subform-hists forms hist)))
+
+(define (smap-in-order procedure forms hist)
+ (map-in-order procedure forms (subform-hists forms hist)))
+
+(define (sfor-each procedure forms hist)
+ (for-each procedure forms (subform-hists forms hist)))
\ No newline at end of file