diff options
author | Munyoki Kilyungi | 2023-07-11 15:24:39 +0300 |
---|---|---|
committer | BonfaceKilz | 2023-07-30 12:29:56 +0300 |
commit | bc3e2fe8bfbe0d9223318c72f35d8f9b2f6b10f5 (patch) | |
tree | 53b403029e176f41ecad06c7375f49283e94f972 /dump | |
parent | 64d5a6f645891eb9f3d7e6a9cd6f08d6b18bd384 (diff) | |
download | gn-transform-databases-bc3e2fe8bfbe0d9223318c72f35d8f9b2f6b10f5.tar.gz |
Create a new procedure for shadowing a file port
* dump/documentation.scm (dump): Export call-with-documentation.
(call-with-documentation): New function.
Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
Diffstat (limited to 'dump')
-rw-r--r-- | dump/documentation.scm | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/dump/documentation.scm b/dump/documentation.scm index 4c0fd88..81eec43 100644 --- a/dump/documentation.scm +++ b/dump/documentation.scm @@ -4,7 +4,9 @@ dump-configuration? dump-configuration-triples? dump-configuration-table-metadata? - dump-configuration-path)) + dump-configuration-path + call-with-documentation)) + (define-immutable-record-type <dump-configuration> (%dump-configuration triples? table-metadata? path) @@ -22,3 +24,12 @@ (%dump-configuration triples? table-metadata? path)) +(define (call-with-documentation conf proc) + (let ((port #f) + (path (dump-configuration-path conf))) + (when path + (dynamic-wind + (lambda () + (set! port (open-file path "w"))) + (cut proc port) + (cut close port))))) |