From: Chris Hanson Date: Sat, 20 Jan 2018 04:01:40 +0000 (-0800) Subject: Two small simplifications. X-Git-Tag: mit-scheme-pucked-x11-0.3.1~7^2~334 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=d04456a60bc68b10964fd3163240ed19cc432e4a;p=mit-scheme.git Two small simplifications. --- diff --git a/src/runtime/syntax-classify.scm b/src/runtime/syntax-classify.scm index 125b883ac..1ad20bd2e 100644 --- a/src/runtime/syntax-classify.scm +++ b/src/runtime/syntax-classify.scm @@ -82,32 +82,23 @@ USA. (keyword-value-item/item item) item)) -(define (classify/forms forms environment) - (map (lambda (form) - (classify/form form environment)) - forms)) - (define (classify/expression expression environment) (classify/form expression environment)) (define (classify/expressions expressions environment) - (classify/forms expressions environment)) + (map (lambda (expression) + (classify/expression expression environment)) + expressions)) (define (classify/body forms environment) - ;; Top-level syntactic definitions affect all forms that appear - ;; after them, so classify FORMS in order. + ;; Syntactic definitions affect all forms that appear after them, so classify + ;; FORMS in order. (make-body-item - (let forms-loop ((forms forms) (body-items '())) + (let loop ((forms forms) (body-items '())) (if (pair? forms) - (let items-loop - ((items (item->list (classify/form (car forms) environment))) - (body-items body-items)) - (if (pair? items) - (items-loop (cdr items) - (if (null-binding-item? (car items)) - body-items - (cons (car items) body-items))) - (forms-loop (cdr forms) body-items))) + (loop (cdr forms) + (reverse* (item->list (classify/form (car forms) environment)) + body-items)) (reverse! body-items))))) (define (extract-declarations-from-body items)