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
- 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

View file

@ -239,8 +239,13 @@
(lambda (d acc)
(cond
((tagged-list? 'cond-expand d)
(cons (expander d) acc))
;(lib:cond-expand-decls (expander d)))
(let* ((expr (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
(cons d acc)) ))
'()