Issue #137 - added the include macro

This commit is contained in:
Justin Ethier 2016-11-19 11:29:35 +00:00
parent a08e946380
commit 4bfece04a3
2 changed files with 17 additions and 0 deletions

View file

@ -7,6 +7,7 @@ Features:
- Recognize escaped vertical line and hex scalar value characters when reading a string.
- Added `current-thread` to SRFI 18.
- Added the `include` macro.
Bug Fixes

View file

@ -13,9 +13,25 @@
(export
read
read-all
include
)
(begin
(define-syntax include
(er-macro-transformer
(lambda (expr rename compare)
(apply
append
(cons
'(begin)
(map
(lambda (filename)
(call-with-port
(open-input-file filename)
(lambda (port)
(read-all port))))
(cdr expr)))))))
(define read cyc-read)
;; Extended information for each input port