mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-18 01:30:27 +02:00
Merge from stable-2.2
This commit is contained in:
commit
663b26819e
2 changed files with 30 additions and 9 deletions
|
@ -1,7 +1,7 @@
|
||||||
@c -*-texinfo-*-
|
@c -*-texinfo-*-
|
||||||
@c This is part of the GNU Guile Reference Manual.
|
@c This is part of the GNU Guile Reference Manual.
|
||||||
@c Copyright (C) 2010, 2011, 2012, 2013,
|
@c Copyright (C) 2010, 2011, 2012, 2013,
|
||||||
@c 2014 Free Software Foundation, Inc.
|
@c 2014, 2019 Free Software Foundation, Inc.
|
||||||
@c See the file guile.texi for copying conditions.
|
@c See the file guile.texi for copying conditions.
|
||||||
|
|
||||||
@node R6RS Support
|
@node R6RS Support
|
||||||
|
@ -1680,9 +1680,22 @@ Return a transcoder associated with the encoding of @var{port}.
|
||||||
@end deffn
|
@end deffn
|
||||||
|
|
||||||
@deffn {Scheme Procedure} binary-port? port
|
@deffn {Scheme Procedure} binary-port? port
|
||||||
@deffnx {Scheme Procedure} textual-port? port
|
Return @code{#t} if @var{port} appears to be a binary port, else return
|
||||||
Return @code{#t}, as all ports in Guile are suitable for binary and
|
@code{#f}. Note that Guile does not currently distinguish between
|
||||||
textual I/O. @xref{Encoding}, for more details.
|
binary and textual ports, so this predicate is not a reliable indicator
|
||||||
|
of whether the port was created as a binary port. Currently, it returns
|
||||||
|
@code{#t} if and only if the port encoding is ``ISO-8859-1'', because
|
||||||
|
Guile uses this encoding when creating a binary port. @xref{Encoding},
|
||||||
|
for more details.
|
||||||
|
@end deffn
|
||||||
|
|
||||||
|
@deffn {Scheme Procedure} textual-port? port
|
||||||
|
Return @code{#t} if @var{port} appears to be a textual port, else return
|
||||||
|
@code{#f}. Note that Guile does not currently distinguish between
|
||||||
|
binary and textual ports, so this predicate is not a reliable indicator
|
||||||
|
of whether the port was created as a textual port. Currently, it always
|
||||||
|
returns @code{#t}, because all ports can be used for textual I/O in
|
||||||
|
Guile. @xref{Encoding}, for more details.
|
||||||
@end deffn
|
@end deffn
|
||||||
|
|
||||||
@deffn {Scheme Procedure} transcoded-port binary-port transcoder
|
@deffn {Scheme Procedure} transcoded-port binary-port transcoder
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
;;;; ports.scm --- R6RS port API -*- coding: utf-8 -*-
|
;;;; ports.scm --- R6RS port API -*- coding: utf-8 -*-
|
||||||
|
|
||||||
;;;; Copyright (C) 2009, 2010, 2011, 2013 Free Software Foundation, Inc.
|
;;;; Copyright (C) 2009-2011, 2013, 2019 Free Software Foundation, Inc.
|
||||||
;;;;
|
;;;;
|
||||||
;;;; This library is free software; you can redistribute it and/or
|
;;;; This library is free software; you can redistribute it and/or
|
||||||
;;;; modify it under the terms of the GNU Lesser General Public
|
;;;; modify it under the terms of the GNU Lesser General Public
|
||||||
|
@ -269,13 +269,21 @@ if the port has no transcoder."
|
||||||
"unsupported error handling mode"))))))
|
"unsupported error handling mode"))))))
|
||||||
|
|
||||||
(define (binary-port? port)
|
(define (binary-port? port)
|
||||||
"Always returns @code{#t}, as all ports can be used for binary I/O in
|
"Return @code{#t} if @var{port} appears to be a binary port, else
|
||||||
Guile."
|
return @code{#f}. Note that Guile does not currently distinguish
|
||||||
|
between binary and textual ports, so this predicate is not a reliable
|
||||||
|
indicator of whether the port was created as a binary port. Currently,
|
||||||
|
it returns @code{#t} if and only if the port encoding is ``ISO-8859-1'',
|
||||||
|
because Guile uses this encoding when creating a binary port."
|
||||||
(equal? (port-encoding port) "ISO-8859-1"))
|
(equal? (port-encoding port) "ISO-8859-1"))
|
||||||
|
|
||||||
(define (textual-port? port)
|
(define (textual-port? port)
|
||||||
"Always returns @code{#t}, as all ports can be used for textual I/O in
|
"Return @code{#t} if @var{port} appears to be a textual port, else
|
||||||
Guile."
|
return @code{#f}. Note that Guile does not currently distinguish
|
||||||
|
between binary and textual ports, so this predicate is not a reliable
|
||||||
|
indicator of whether the port was created as a textual port. Currently,
|
||||||
|
it always returns @code{#t}, because all ports can be used for textual
|
||||||
|
I/O in Guile."
|
||||||
#t)
|
#t)
|
||||||
|
|
||||||
(define (port-eof? port)
|
(define (port-eof? port)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue