diff options
author | Hugo Hörnquist <hugo@lysator.liu.se> | 2022-06-23 03:23:44 +0200 |
---|---|---|
committer | Hugo Hörnquist <hugo@lysator.liu.se> | 2022-06-23 03:48:22 +0200 |
commit | 1976980d4a272fb7fc3694c734bfc6825edfc721 (patch) | |
tree | 8460db1176c64895e9968447588953fac85fe7d6 /module/hnh/util/io.scm | |
parent | Remove all inline use-modules. (diff) | |
download | calp-1976980d4a272fb7fc3694c734bfc6825edfc721.tar.gz calp-1976980d4a272fb7fc3694c734bfc6825edfc721.tar.xz |
Centralize (almost) all exports to :export in define-module.
Diffstat (limited to 'module/hnh/util/io.scm')
-rw-r--r-- | module/hnh/util/io.scm | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/module/hnh/util/io.scm b/module/hnh/util/io.scm index 3a595b67..d638ebb4 100644 --- a/module/hnh/util/io.scm +++ b/module/hnh/util/io.scm @@ -1,19 +1,23 @@ (define-module (hnh util io) :use-module ((hnh util) :select (begin1)) - :use-module ((ice-9 rdelim) :select (read-line))) + :use-module ((ice-9 rdelim) :select (read-line)) + :export (open-input-port + open-output-port + read-lines + with-atomic-output-to-file)) -(define-public (open-input-port str) +(define (open-input-port str) (if (string=? "-" str) (current-input-port) (open-input-file str))) -(define-public (open-output-port str) +(define (open-output-port str) (if (string=? "-" str) (current-output-port) (open-output-file str))) -(define-public (read-lines port) +(define (read-lines port) (let ((line (read-line port))) (if (eof-object? line) '() (cons line (read-lines port))))) @@ -26,7 +30,7 @@ ;; ;; propagates the return value of @var{thunk} upon successfully writing ;; the file, and @code{#f} otherwise. -(define-public (with-atomic-output-to-file filename thunk) +(define (with-atomic-output-to-file filename thunk) ;; copy to enusre writable string (define tmpfile (string-copy (string-append (dirname filename) |