Expand contents of cond-expand with a begin context

This commit is contained in:
Justin Ethier 2020-08-29 19:16:19 -04:00
parent ea2f44a318
commit 857c98fb87
2 changed files with 8 additions and 2 deletions

View file

@ -5,6 +5,7 @@
Bug Fixes Bug Fixes
- Add type checking to record type accessor functions. We now raise an error if the passed object is of the wrong record type. - Add type checking to record type accessor functions. We now raise an error if the passed object is of the wrong record type.
- Fix issues with expanding `cond-expand` expressions in libraries. Previously there would be issues with the expansion if the code needed to be within the context of a `begin`.
## 0.20 - August 14, 2020 ## 0.20 - August 14, 2020

View file

@ -239,8 +239,13 @@
(lambda (d acc) (lambda (d acc)
(cond (cond
((tagged-list? 'cond-expand d) ((tagged-list? 'cond-expand d)
(cons (expander d) acc)) (let* ((expr (expander d))
;(lib:cond-expand-decls (expander d))) (begin? (and (pair? expr)
(not (member (car expr)
'(import export c-linker-options include-c-header))))))
(if begin?
(cons `(begin ,expr) acc)
(cons expr acc))))
(else (else
(cons d acc)) )) (cons d acc)) ))
'() '()