summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndy Wingo <wingo@pobox.com>2016-04-30 14:44:20 +0200
committerAndy Wingo <wingo@pobox.com>2016-04-30 14:44:20 +0200
commit555c934726636f1dfd5e1048cda4c31fbeaaa3f4 (patch)
tree7bd7df389d89b0da7c6de32fe1f0371008e86662
parent8bad621fec65d58768a38661278165ae259fabce (diff)
downloadguile-555c934726636f1dfd5e1048cda4c31fbeaaa3f4.tar.gz
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.
-rw-r--r--libguile/ports.c4
-rw-r--r--module/ice-9/ports.scm2
2 files changed, 2 insertions, 4 deletions
diff --git a/libguile/ports.c b/libguile/ports.c
index 8c8276b26..058d7dcf3 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 0dd1df718..388b2584a 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))