~ chicken-core (chicken-5) 1dc54cbab2090219c41b95dce762c02b32c62e28
commit 1dc54cbab2090219c41b95dce762c02b32c62e28 Author: felix <felix@call-with-current-continuation.org> AuthorDate: Sat Mar 8 08:42:40 2025 +0100 Commit: felix <felix@call-with-current-continuation.org> CommitDate: Sat Mar 8 08:42:40 2025 +0100 fix handling of include-library-declarations, inline use of append-map, which isn't available here diff --git a/expand.scm b/expand.scm index 3c5e6975..dc2b9a08 100644 --- a/expand.scm +++ b/expand.scm @@ -1285,11 +1285,17 @@ ##sys#current-source-filename ci? (lambda (forms path) (map expand/begin forms))))) (define (process-include-decls fnames) - (parse-decls (append-map (lambda (fname) (read-forms fname #t)) fnames))) + (parse-decls + (let loop ((fnames fnames) (all '())) + (if (null? fnames) + (reverse all) + (let ((forms (read-forms (car fnames) #t))) + (loop (cdr fnames) + (append (reverse forms) all))))))) (define (fail spec) (##sys#syntax-error 'define-library "invalid library declaration" spec)) (define (parse-decls decls) - (cond ((null? decls) '(##core#begin)) + (cond ((null? decls) '(##core#begin)) ((and (pair? decls) (pair? (car decls))) (let ((spec (car decls)) (more (cdr decls))) @@ -1316,7 +1322,7 @@ ((cond-expand) `(##core#begin ,@(process-cond-expand (cdr spec)) ,(parse-decls more))) - ((begin) + ((begin ##core#begin) `(##core#begin ,@(cdr spec) ,(parse-decls more))) (else (fail spec)))))Trap