mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-05-20 11:40:18 +02:00
Refactor way the-eof-object is defined
* libguile/ports.c (scm_init_ice_9_ports): Define the-eof-object here. Update a comment. * module/ice-9/ports.scm: Use the-eof-object definition from C.
This commit is contained in:
parent
8bad621fec
commit
555c934726
2 changed files with 2 additions and 4 deletions
|
@ -3145,13 +3145,13 @@ scm_init_ice_9_ports (void)
|
||||||
{
|
{
|
||||||
#include "libguile/ports.x"
|
#include "libguile/ports.x"
|
||||||
|
|
||||||
|
scm_c_define ("the-eof-object", SCM_EOF_VAL);
|
||||||
|
|
||||||
/* lseek() symbols. */
|
/* lseek() symbols. */
|
||||||
scm_c_define ("SEEK_SET", scm_from_int (SEEK_SET));
|
scm_c_define ("SEEK_SET", scm_from_int (SEEK_SET));
|
||||||
scm_c_define ("SEEK_CUR", scm_from_int (SEEK_CUR));
|
scm_c_define ("SEEK_CUR", scm_from_int (SEEK_CUR));
|
||||||
scm_c_define ("SEEK_END", scm_from_int (SEEK_END));
|
scm_c_define ("SEEK_END", scm_from_int (SEEK_END));
|
||||||
|
|
||||||
/* These bindings are used when boot-9 turns `current-input-port' et
|
|
||||||
al into parameters. They are then removed from the guile module. */
|
|
||||||
scm_c_define ("%current-input-port-fluid", cur_inport_fluid);
|
scm_c_define ("%current-input-port-fluid", cur_inport_fluid);
|
||||||
scm_c_define ("%current-output-port-fluid", cur_outport_fluid);
|
scm_c_define ("%current-output-port-fluid", cur_outport_fluid);
|
||||||
scm_c_define ("%current-error-port-fluid", cur_errport_fluid);
|
scm_c_define ("%current-error-port-fluid", cur_errport_fluid);
|
||||||
|
|
|
@ -461,8 +461,6 @@ written into the port is returned."
|
||||||
(call-with-output-string
|
(call-with-output-string
|
||||||
(lambda (p) (with-error-to-port p thunk))))
|
(lambda (p) (with-error-to-port p thunk))))
|
||||||
|
|
||||||
(define the-eof-object (call-with-input-string "" (lambda (p) (read-char p))))
|
|
||||||
|
|
||||||
(define (inherit-print-state old-port new-port)
|
(define (inherit-print-state old-port new-port)
|
||||||
(if (get-print-state old-port)
|
(if (get-print-state old-port)
|
||||||
(port-with-print-state new-port (get-print-state old-port))
|
(port-with-print-state new-port (get-print-state old-port))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue