[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Guile-commits] 03/05: Refactor way the-eof-object is defined
From: |
Andy Wingo |
Subject: |
[Guile-commits] 03/05: Refactor way the-eof-object is defined |
Date: |
Sat, 30 Apr 2016 12:49:57 +0000 |
wingo pushed a commit to branch wip-port-refactor
in repository guile.
commit 555c934726636f1dfd5e1048cda4c31fbeaaa3f4
Author: Andy Wingo <address@hidden>
Date: Sat Apr 30 14:44:20 2016 +0200
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.
---
libguile/ports.c | 4 ++--
module/ice-9/ports.scm | 2 --
2 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/libguile/ports.c b/libguile/ports.c
index 8c8276b..058d7dc 100644
--- a/libguile/ports.c
+++ b/libguile/ports.c
@@ -3145,13 +3145,13 @@ scm_init_ice_9_ports (void)
{
#include "libguile/ports.x"
+ scm_c_define ("the-eof-object", SCM_EOF_VAL);
+
/* lseek() symbols. */
scm_c_define ("SEEK_SET", scm_from_int (SEEK_SET));
scm_c_define ("SEEK_CUR", scm_from_int (SEEK_CUR));
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-output-port-fluid", cur_outport_fluid);
scm_c_define ("%current-error-port-fluid", cur_errport_fluid);
diff --git a/module/ice-9/ports.scm b/module/ice-9/ports.scm
index 0dd1df7..388b258 100644
--- a/module/ice-9/ports.scm
+++ b/module/ice-9/ports.scm
@@ -461,8 +461,6 @@ written into the port is returned."
(call-with-output-string
(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)
(if (get-print-state old-port)
(port-with-print-state new-port (get-print-state old-port))