mirror of
https://github.com/justinethier/cyclone.git
synced 2025-05-24 20:45:06 +02:00
Issue #137 - added the include
macro
This commit is contained in:
parent
a08e946380
commit
4bfece04a3
2 changed files with 17 additions and 0 deletions
|
@ -7,6 +7,7 @@ Features:
|
||||||
|
|
||||||
- Recognize escaped vertical line and hex scalar value characters when reading a string.
|
- Recognize escaped vertical line and hex scalar value characters when reading a string.
|
||||||
- Added `current-thread` to SRFI 18.
|
- Added `current-thread` to SRFI 18.
|
||||||
|
- Added the `include` macro.
|
||||||
|
|
||||||
Bug Fixes
|
Bug Fixes
|
||||||
|
|
||||||
|
|
|
@ -13,9 +13,25 @@
|
||||||
(export
|
(export
|
||||||
read
|
read
|
||||||
read-all
|
read-all
|
||||||
|
include
|
||||||
)
|
)
|
||||||
(begin
|
(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)
|
(define read cyc-read)
|
||||||
|
|
||||||
;; Extended information for each input port
|
;; Extended information for each input port
|
||||||
|
|
Loading…
Add table
Reference in a new issue