guile-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Guile-commits] GNU Guile branch, master, updated. release_1-9-14-73-gb0


From: Andy Wingo
Subject: [Guile-commits] GNU Guile branch, master, updated. release_1-9-14-73-gb04f841
Date: Fri, 21 Jan 2011 07:22:27 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Guile".

http://git.savannah.gnu.org/cgit/guile.git/commit/?id=b04f841d5fa6d3448bb8f976bb27ee3e9a06f83c

The branch, master has been updated
       via  b04f841d5fa6d3448bb8f976bb27ee3e9a06f83c (commit)
      from  dc78bee588718ce4df252e5d1773b9d895c6f43f (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit b04f841d5fa6d3448bb8f976bb27ee3e9a06f83c
Author: Andy Wingo <address@hidden>
Date:   Fri Jan 21 08:27:08 2011 +0100

    implement port-eof?
    
    * module/rnrs/io/ports.scm (port-eof?): Implement.
    * module/rnrs.scm: Re-export port-eof?.
    
    * test-suite/tests/r6rs-ports.test ("7.2.5 End-of-File Object"): Add
      test.
    
    Thanks to Göran Weinholt for the report.

-----------------------------------------------------------------------

Summary of changes:
 module/rnrs.scm                  |    5 +++--
 module/rnrs/io/ports.scm         |    8 +++++++-
 test-suite/tests/r6rs-ports.test |    7 +++++--
 3 files changed, 15 insertions(+), 5 deletions(-)

diff --git a/module/rnrs.scm b/module/rnrs.scm
index e10967b..476a3ab 100644
--- a/module/rnrs.scm
+++ b/module/rnrs.scm
@@ -1,6 +1,6 @@
 ;;; rnrs.scm --- The R6RS composite library
 
-;;      Copyright (C) 2010 Free Software Foundation, Inc.
+;;      Copyright (C) 2010, 2011 Free Software Foundation, Inc.
 ;;
 ;; This library is free software; you can redistribute it and/or
 ;; modify it under the terms of the GNU Lesser General Public
@@ -165,7 +165,8 @@
          make-transcoder transcoder-codec native-transcoder
          latin-1-codec utf-8-codec utf-16-codec
          
-         eof-object? port? input-port? output-port? eof-object port-transcoder
+         eof-object? port? input-port? output-port? eof-object port-eof?
+         port-transcoder
          binary-port? transcoded-port port-position set-port-position!
          port-has-port-position? port-has-set-port-position!?
           close-port call-with-port
diff --git a/module/rnrs/io/ports.scm b/module/rnrs/io/ports.scm
index 854ea09..15d62bd 100644
--- a/module/rnrs/io/ports.scm
+++ b/module/rnrs/io/ports.scm
@@ -1,6 +1,6 @@
 ;;;; ports.scm --- R6RS port API                    -*- coding: utf-8 -*-
 
-;;;;   Copyright (C) 2009, 2010 Free Software Foundation, Inc.
+;;;;   Copyright (C) 2009, 2010, 2011 Free Software Foundation, Inc.
 ;;;;
 ;;;; This library is free software; you can redistribute it and/or
 ;;;; modify it under the terms of the GNU Lesser General Public
@@ -37,6 +37,7 @@
            
           ;; input & output ports
           port? input-port? output-port?
+          port-eof?
           port-transcoder binary-port? transcoded-port
           port-position set-port-position!
           port-has-port-position? port-has-set-port-position!?
@@ -191,6 +192,11 @@
   ;; So far, we don't support transcoders other than the binary transcoder.
   #t)
 
+(define (port-eof? port)
+  (eof-object? (if (binary-port? port)
+                   (lookahead-u8 port)
+                   (lookahead-char port))))
+
 (define (transcoded-port port transcoder)
   "Return a new textual port based on @var{port}, using
 @var{transcoder} to encode and decode data written to or
diff --git a/test-suite/tests/r6rs-ports.test b/test-suite/tests/r6rs-ports.test
index 40bde08..410e9d1 100644
--- a/test-suite/tests/r6rs-ports.test
+++ b/test-suite/tests/r6rs-ports.test
@@ -1,6 +1,6 @@
 ;;;; r6rs-ports.test --- R6RS I/O port tests.   -*- coding: utf-8; -*-
 ;;;;
-;;;; Copyright (C) 2009, 2010 Free Software Foundation, Inc.
+;;;; Copyright (C) 2009, 2010, 2011 Free Software Foundation, Inc.
 ;;;; Ludovic Courtès
 ;;;;
 ;;;; This library is free software; you can redistribute it and/or
@@ -35,7 +35,10 @@
 
   (pass-if "eof-object"
     (and (eqv? (eof-object) (eof-object))
-         (eq?  (eof-object) (eof-object)))))
+         (eq?  (eof-object) (eof-object))))
+
+  (pass-if "port-eof?"
+    (port-eof? (open-input-string ""))))
 
 
 (with-test-prefix "7.2.8 Binary Input"


hooks/post-receive
-- 
GNU Guile



reply via email to

[Prev in Thread] Current Thread [Next in Thread]