summaryrefslogtreecommitdiff
path: root/module/rnrs/io
diff options
context:
space:
mode:
authorAndreas Rottmann <a.rottmann@gmx.at>2010-11-21 23:17:51 +0100
committerLudovic Courtès <ludo@gnu.org>2010-11-24 23:04:24 +0100
commitbaa5705ca726c261c9aa37d3b9af52f3949690ac (patch)
tree588cbbb96428b3df73920fd01293e64c8d18030a /module/rnrs/io
parent644c5165ee449a3beccadeb969e02746954703ee (diff)
downloadguile-baa5705ca726c261c9aa37d3b9af52f3949690ac.tar.gz
Turn `(rnrs io ports)' into an R6RS library
* module/rnrs/io/ports.scm: Change into an R6RS library from a "regular" Guile module, so the bookkeeping for #:re-export and #:replace is done automatically and we gain control over the imports from `(guile)'. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
Diffstat (limited to 'module/rnrs/io')
-rw-r--r--module/rnrs/io/ports.scm58
1 files changed, 30 insertions, 28 deletions
diff --git a/module/rnrs/io/ports.scm b/module/rnrs/io/ports.scm
index 04dabe6c9..22460496f 100644
--- a/module/rnrs/io/ports.scm
+++ b/module/rnrs/io/ports.scm
@@ -26,34 +26,34 @@
;;;
;;; Code:
-(define-module (rnrs io ports)
- #:version (6)
- #:re-export (eof-object? port? input-port? output-port?)
- #:export (eof-object
-
- ;; input & output ports
- port-transcoder binary-port? transcoded-port
- port-position set-port-position!
- port-has-port-position? port-has-set-port-position!?
- call-with-port
-
- ;; input ports
- open-bytevector-input-port
- open-string-input-port
- make-custom-binary-input-port
-
- ;; binary input
- get-u8 lookahead-u8
- get-bytevector-n get-bytevector-n!
- get-bytevector-some get-bytevector-all
-
- ;; output ports
- open-bytevector-output-port
- open-string-output-port
- make-custom-binary-output-port
-
- ;; binary output
- put-u8 put-bytevector))
+(library (rnrs io ports (6))
+ (export eof-object eof-object?
+
+ ;; input & output ports
+ port? input-port? output-port?
+ port-transcoder binary-port? transcoded-port
+ port-position set-port-position!
+ port-has-port-position? port-has-set-port-position!?
+ call-with-port
+
+ ;; input ports
+ open-bytevector-input-port
+ open-string-input-port
+ make-custom-binary-input-port
+
+ ;; binary input
+ get-u8 lookahead-u8
+ get-bytevector-n get-bytevector-n!
+ get-bytevector-some get-bytevector-all
+
+ ;; output ports
+ open-bytevector-output-port
+ open-string-output-port
+ make-custom-binary-output-port
+
+ ;; binary output
+ put-u8 put-bytevector)
+ (import (guile))
(load-extension (string-append "libguile-" (effective-version))
"scm_init_r6rs_ports")
@@ -121,4 +121,6 @@ as a string, and a thunk to retrieve the characters associated with that port."
(values port
(lambda () (get-output-string port)))))
+)
+
;;; ports.scm ends here