support top-level begin in define-library

This commit is contained in:
Yuichi Nishiwaki
2017-04-12 14:17:52 +09:00
parent cf63d541a2
commit 9cc40bd46a
2 changed files with 111 additions and 103 deletions
+6 -1
View File
@@ -91,7 +91,12 @@
(parameterize ((current-library name))
(for-each
(lambda (expr)
(eval expr name)) ; TODO parse library declarations
(let ((exprs (if (and (pair? expr) (eq? (car expr) 'begin))
(cdr expr)
(list expr))))
(for-each
(lambda (e) (eval e name))
exprs)))
body)))))
(define-transformer 'cond-expand