mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-04-29 19:30:36 +02:00
Reorganize the R6RS I/O condition types
Move the I/O condition types from `(rnrs conditions)', where they were not exported, to `(rnrs files)', where they are. * module/rnrs/conditions.scm: Remove definition of I/O condition types. * module/rnrs/files.scm: Replace references to I/O condition types inside `(rnrs conditions)' with the actual definitions. * module/rnrs/io/simple.scm: Don't `@@'-reference the I/O condition types, just imported them from `(rnrs files)'. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
This commit is contained in:
parent
baa5705ca7
commit
50851f1d18
4 changed files with 30 additions and 177 deletions
|
@ -244,45 +244,7 @@
|
|||
(rnrs enums (6))
|
||||
(rnrs exceptions (6))
|
||||
|
||||
;; These i/o conditions are exported by (io simple), (files), and
|
||||
;; should be exported by (ports) but are not yet. Avoid duplicate
|
||||
;; bindings warnings, then, by excluding these bindings from all but
|
||||
;; (io simple).
|
||||
(except (rnrs files (6))
|
||||
&i/o make-i/o-error i/o-error?
|
||||
&i/o-read make-i/o-read-error i/o-read-error?
|
||||
&i/o-write make-i/o-write-error i/o-write-error?
|
||||
|
||||
&i/o-invalid-position
|
||||
make-i/o-invalid-position-error
|
||||
i/o-invalid-position-error?
|
||||
i/o-error-position
|
||||
|
||||
&i/o-filename
|
||||
make-i/o-filename-error
|
||||
i/o-filename-error?
|
||||
i/o-error-filename
|
||||
|
||||
&i/o-file-protection
|
||||
make-i/o-file-protection-error
|
||||
i/o-file-protection-error?
|
||||
|
||||
&i/o-file-is-read-only
|
||||
make-i/o-file-is-read-only-error
|
||||
i/o-file-is-read-only-error?
|
||||
|
||||
&i/o-file-already-exists
|
||||
make-i/o-file-already-exists-error
|
||||
i/o-file-already-exists-error?
|
||||
|
||||
&i/o-file-does-not-exist
|
||||
make-i/o-file-does-not-exist-error
|
||||
i/o-file-does-not-exist-error?
|
||||
|
||||
&i/o-port
|
||||
make-i/o-port-error
|
||||
i/o-port-error?
|
||||
i/o-error-port)
|
||||
(rnrs files (6))
|
||||
|
||||
(rnrs hashtables (6))
|
||||
|
||||
|
|
|
@ -229,30 +229,4 @@
|
|||
(define-condition-type &undefined &violation
|
||||
make-undefined-violation undefined-violation?)
|
||||
|
||||
;; Condition types that are used by (rnrs files), (rnrs io ports), and
|
||||
;; (rnrs io simple). These are defined here so as to be easily shareable by
|
||||
;; these three libraries.
|
||||
|
||||
(define-condition-type &i/o &error make-i/o-error i/o-error?)
|
||||
(define-condition-type &i/o-read &i/o make-i/o-read-error i/o-read-error?)
|
||||
(define-condition-type &i/o-write &i/o make-i/o-write-error i/o-write-error?)
|
||||
(define-condition-type &i/o-invalid-position
|
||||
&i/o make-i/o-invalid-position-error i/o-invalid-position-error?
|
||||
(position i/o-error-position))
|
||||
(define-condition-type &i/o-filename
|
||||
&i/o make-i/o-filename-error i/o-filename-error?
|
||||
(filename i/o-error-filename))
|
||||
(define-condition-type &i/o-file-protection
|
||||
&i/o-filename make-i/o-file-protection-error i/o-file-protection-error?)
|
||||
(define-condition-type &i/o-file-is-read-only
|
||||
&i/o-file-protection make-i/o-file-is-read-only-error
|
||||
i/o-file-is-read-only-error?)
|
||||
(define-condition-type &i/o-file-already-exists
|
||||
&i/o-filename make-i/o-file-already-exists-error
|
||||
i/o-file-already-exists-error?)
|
||||
(define-condition-type &i/o-file-does-not-exist
|
||||
&i/o-filename make-i/o-file-does-not-exist-error
|
||||
i/o-file-does-not-exist-error?)
|
||||
(define-condition-type &i/o-port &i/o make-i/o-port-error i/o-port-error?
|
||||
(port i/o-error-port))
|
||||
)
|
||||
|
|
|
@ -67,59 +67,30 @@
|
|||
(lambda () (delete-file-internal filename))
|
||||
(lambda (key . args) (raise (make-i/o-filename-error filename)))))
|
||||
|
||||
(define &i/o (@@ (rnrs conditions) &i/o))
|
||||
(define make-i/o-error (@@ (rnrs conditions) make-i/o-error))
|
||||
(define i/o-error? (@@ (rnrs conditions) i/o-error?))
|
||||
|
||||
(define &i/o-read (@@ (rnrs conditions) &i/o-read))
|
||||
(define make-i/o-read-error (@@ (rnrs conditions) make-i/o-read-error))
|
||||
(define i/o-read-error? (@@ (rnrs conditions) i/o-read-error?))
|
||||
|
||||
(define &i/o-write (@@ (rnrs conditions) &i/o-write))
|
||||
(define make-i/o-write-error (@@ (rnrs conditions) make-i/o-write-error))
|
||||
(define i/o-write-error? (@@ (rnrs conditions) i/o-write-error?))
|
||||
|
||||
(define &i/o-invalid-position (@@ (rnrs conditions) &i/o-invalid-position))
|
||||
(define make-i/o-invalid-position-error
|
||||
(@@ (rnrs conditions) make-i/o-invalid-position-error))
|
||||
(define i/o-invalid-position-error?
|
||||
(@@ (rnrs conditions) i/o-invalid-position-error?))
|
||||
(define i/o-error-position (@@ (rnrs conditions) i/o-error-position))
|
||||
|
||||
(define &i/o-filename (@@ (rnrs conditions) &i/o-filename))
|
||||
(define make-i/o-filename-error
|
||||
(@@ (rnrs conditions) make-i/o-filename-error))
|
||||
(define i/o-filename-error? (@@ (rnrs conditions) i/o-filename-error?))
|
||||
(define i/o-error-filename (@@ (rnrs conditions) i/o-error-filename))
|
||||
|
||||
(define &i/o-file-protection (@@ (rnrs conditions) &i/o-file-protection))
|
||||
(define make-i/o-file-protection-error
|
||||
(@@ (rnrs conditions) make-i/o-file-protection-error))
|
||||
(define i/o-file-protection-error?
|
||||
(@@ (rnrs conditions) i/o-file-protection-error?))
|
||||
|
||||
(define &i/o-file-is-read-only (@@ (rnrs conditions) &i/o-file-is-read-only))
|
||||
(define make-i/o-file-is-read-only-error
|
||||
(@@ (rnrs conditions) make-i/o-file-is-read-only-error))
|
||||
(define i/o-file-is-read-only-error?
|
||||
(@@ (rnrs conditions) i/o-file-is-read-only-error?))
|
||||
|
||||
(define &i/o-file-already-exists
|
||||
(@@ (rnrs conditions) &i/o-file-already-exists))
|
||||
(define make-i/o-file-already-exists-error
|
||||
(@@ (rnrs conditions) make-i/o-file-already-exists-error))
|
||||
(define i/o-file-already-exists-error?
|
||||
(@@ (rnrs conditions) i/o-file-already-exists-error?))
|
||||
|
||||
(define &i/o-file-does-not-exist
|
||||
(@@ (rnrs conditions) &i/o-file-does-not-exist))
|
||||
(define make-i/o-file-does-not-exist-error
|
||||
(@@ (rnrs conditions) make-i/o-file-does-not-exist-error))
|
||||
(define i/o-file-does-not-exist-error?
|
||||
(@@ (rnrs conditions) i/o-file-does-not-exist-error?))
|
||||
|
||||
(define &i/o-port (@@ (rnrs conditions) &i/o-port))
|
||||
(define make-i/o-port-error (@@ (rnrs conditions) make-i/o-port-error))
|
||||
(define i/o-port-error? (@@ (rnrs conditions) i/o-port-error?))
|
||||
(define i/o-error-port (@@ (rnrs conditions) i/o-error-port))
|
||||
;; Condition types that are used by (rnrs files), (rnrs io ports), and
|
||||
;; (rnrs io simple). These are defined here so as to be easily shareable by
|
||||
;; these three libraries.
|
||||
|
||||
(define-condition-type &i/o &error make-i/o-error i/o-error?)
|
||||
(define-condition-type &i/o-read &i/o make-i/o-read-error i/o-read-error?)
|
||||
(define-condition-type &i/o-write &i/o make-i/o-write-error i/o-write-error?)
|
||||
(define-condition-type &i/o-invalid-position
|
||||
&i/o make-i/o-invalid-position-error i/o-invalid-position-error?
|
||||
(position i/o-error-position))
|
||||
(define-condition-type &i/o-filename
|
||||
&i/o make-i/o-filename-error i/o-filename-error?
|
||||
(filename i/o-error-filename))
|
||||
(define-condition-type &i/o-file-protection
|
||||
&i/o-filename make-i/o-file-protection-error i/o-file-protection-error?)
|
||||
(define-condition-type &i/o-file-is-read-only
|
||||
&i/o-file-protection make-i/o-file-is-read-only-error
|
||||
i/o-file-is-read-only-error?)
|
||||
(define-condition-type &i/o-file-already-exists
|
||||
&i/o-filename make-i/o-file-already-exists-error
|
||||
i/o-file-already-exists-error?)
|
||||
(define-condition-type &i/o-file-does-not-exist
|
||||
&i/o-filename make-i/o-file-does-not-exist-error
|
||||
i/o-file-does-not-exist-error?)
|
||||
(define-condition-type &i/o-port &i/o make-i/o-port-error i/o-port-error?
|
||||
(port i/o-error-port))
|
||||
)
|
||||
|
|
|
@ -113,61 +113,7 @@
|
|||
display
|
||||
write)
|
||||
(rnrs base (6))
|
||||
(rnrs conditions (6)))
|
||||
|
||||
(define &i/o (@@ (rnrs conditions) &i/o))
|
||||
(define make-i/o-error (@@ (rnrs conditions) make-i/o-error))
|
||||
(define i/o-error? (@@ (rnrs conditions) i/o-error?))
|
||||
|
||||
(define &i/o-read (@@ (rnrs conditions) &i/o-read))
|
||||
(define make-i/o-read-error (@@ (rnrs conditions) make-i/o-read-error))
|
||||
(define i/o-read-error? (@@ (rnrs conditions) i/o-read-error?))
|
||||
|
||||
(define &i/o-write (@@ (rnrs conditions) &i/o-write))
|
||||
(define make-i/o-write-error (@@ (rnrs conditions) make-i/o-write-error))
|
||||
(define i/o-write-error? (@@ (rnrs conditions) i/o-write-error?))
|
||||
|
||||
(define &i/o-invalid-position (@@ (rnrs conditions) &i/o-invalid-position))
|
||||
(define make-i/o-invalid-position-error
|
||||
(@@ (rnrs conditions) make-i/o-invalid-position-error))
|
||||
(define i/o-invalid-position-error?
|
||||
(@@ (rnrs conditions) i/o-invalid-position-error?))
|
||||
(define i/o-error-position (@@ (rnrs conditions) i/o-error-position))
|
||||
|
||||
(define &i/o-filename (@@ (rnrs conditions) &i/o-filename))
|
||||
(define make-i/o-filename-error
|
||||
(@@ (rnrs conditions) make-i/o-filename-error))
|
||||
(define i/o-filename-error? (@@ (rnrs conditions) i/o-filename-error?))
|
||||
(define i/o-error-filename (@@ (rnrs conditions) i/o-error-filename))
|
||||
|
||||
(define &i/o-file-protection (@@ (rnrs conditions) &i/o-file-protection))
|
||||
(define make-i/o-file-protection-error
|
||||
(@@ (rnrs conditions) make-i/o-file-protection-error))
|
||||
(define i/o-file-protection-error?
|
||||
(@@ (rnrs conditions) i/o-file-protection-error?))
|
||||
|
||||
(define &i/o-file-is-read-only (@@ (rnrs conditions) &i/o-file-is-read-only))
|
||||
(define make-i/o-file-is-read-only-error
|
||||
(@@ (rnrs conditions) make-i/o-file-is-read-only-error))
|
||||
(define i/o-file-is-read-only-error?
|
||||
(@@ (rnrs conditions) i/o-file-is-read-only-error?))
|
||||
|
||||
(define &i/o-file-already-exists
|
||||
(@@ (rnrs conditions) &i/o-file-already-exists))
|
||||
(define make-i/o-file-already-exists-error
|
||||
(@@ (rnrs conditions) make-i/o-file-already-exists-error))
|
||||
(define i/o-file-already-exists-error?
|
||||
(@@ (rnrs conditions) i/o-file-already-exists-error?))
|
||||
|
||||
(define &i/o-file-does-not-exist
|
||||
(@@ (rnrs conditions) &i/o-file-does-not-exist))
|
||||
(define make-i/o-file-does-not-exist-error
|
||||
(@@ (rnrs conditions) make-i/o-file-does-not-exist-error))
|
||||
(define i/o-file-does-not-exist-error?
|
||||
(@@ (rnrs conditions) i/o-file-does-not-exist-error?))
|
||||
|
||||
(define &i/o-port (@@ (rnrs conditions) &i/o-port))
|
||||
(define make-i/o-port-error (@@ (rnrs conditions) make-i/o-port-error))
|
||||
(define i/o-port-error? (@@ (rnrs conditions) i/o-port-error?))
|
||||
(define i/o-error-port (@@ (rnrs conditions) i/o-error-port))
|
||||
(rnrs files (6)) ;for the condition types
|
||||
)
|
||||
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue