guile-commits
[Top][All Lists]
Advanced

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

[Guile-commits] GNU Guile branch, stable-2.0, updated. v2.0.0-3-g6854c32


From: Andy Wingo
Subject: [Guile-commits] GNU Guile branch, stable-2.0, updated. v2.0.0-3-g6854c32
Date: Fri, 18 Feb 2011 15:14:01 +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=6854c32480e95ca54e95da585e74002d8897573c

The branch, stable-2.0 has been updated
       via  6854c32480e95ca54e95da585e74002d8897573c (commit)
       via  dd0d987fbdf32387ff4b36631302918ca8ff36cb (commit)
      from  7e23d9d0f1efd8d62e8fbe1341d0e1ea54b2eb57 (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 6854c32480e95ca54e95da585e74002d8897573c
Author: Andy Wingo <address@hidden>
Date:   Fri Feb 18 15:57:27 2011 +0100

    core modules use (ice-9 binary-ports) instead of (rnrs io ports)
    
    * module/language/assembly/compile-bytecode.scm:
    * module/language/elisp/lexer.scm:
    * module/web/request.scm:
    * module/web/response.scm:
    * module/web/server.scm:
    * module/web/uri.scm: Use ice-9 binary-ports.

commit dd0d987fbdf32387ff4b36631302918ca8ff36cb
Author: Andy Wingo <address@hidden>
Date:   Fri Feb 18 15:52:02 2011 +0100

    add (ice-9 binary-ports)
    
    * module/ice-9/binary-ports.scm: New module.
    * module/Makefile.am: Add to makefile.
    
    * module/rnrs/io/ports.scm: Re-export bindings from (ice-9 binary
      ports).  This will allow the compiler to not pull (rnrs) into its
      included module set.

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

Summary of changes:
 module/Makefile.am                            |    1 +
 module/ice-9/binary-ports.scm                 |   49 +++++++++++++++++++++++++
 module/language/assembly/compile-bytecode.scm |    6 +++-
 module/language/elisp/lexer.scm               |    2 +-
 module/rnrs/io/ports.scm                      |    9 ++---
 module/web/request.scm                        |    2 +-
 module/web/response.scm                       |    2 +-
 module/web/server.scm                         |    2 +-
 module/web/uri.scm                            |    2 +-
 9 files changed, 64 insertions(+), 11 deletions(-)
 create mode 100644 module/ice-9/binary-ports.scm

diff --git a/module/Makefile.am b/module/Makefile.am
index 9940900..c0f6886 100644
--- a/module/Makefile.am
+++ b/module/Makefile.am
@@ -180,6 +180,7 @@ ICE_9_SOURCES = \
   ice-9/r5rs.scm \
   ice-9/deprecated.scm \
   ice-9/and-let-star.scm \
+  ice-9/binary-ports.scm \
   ice-9/calling.scm \
   ice-9/common-list.scm \
   ice-9/control.scm \
diff --git a/module/ice-9/binary-ports.scm b/module/ice-9/binary-ports.scm
new file mode 100644
index 0000000..63d09cf
--- /dev/null
+++ b/module/ice-9/binary-ports.scm
@@ -0,0 +1,49 @@
+;;;; binary-ports.scm --- Binary IO on ports
+
+;;;;   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
+;;;; License as published by the Free Software Foundation; either
+;;;; version 3 of the License, or (at your option) any later version.
+;;;;
+;;;; This library is distributed in the hope that it will be useful,
+;;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+;;;; Lesser General Public License for more details.
+;;;;
+;;;; You should have received a copy of the GNU Lesser General Public
+;;;; License along with this library; if not, write to the Free Software
+;;;; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 
USA
+
+;;; Author: Ludovic Courtès <address@hidden>
+
+;;; Commentary:
+;;;
+;;; The I/O port API of the R6RS is provided by this module.  In many areas
+;;; it complements or refines Guile's own historical port API.  For instance,
+;;; it allows for binary I/O with bytevectors.
+;;;
+;;; Code:
+
+(define-module (ice-9 binary-ports)
+  #:use-module (rnrs bytevectors)
+  #:export (eof-object
+            open-bytevector-input-port
+            make-custom-binary-input-port
+            get-u8
+            lookahead-u8
+            get-bytevector-n
+            get-bytevector-n!
+            get-bytevector-some
+            get-bytevector-all
+            put-u8
+            put-bytevector
+            open-bytevector-output-port
+            make-custom-binary-output-port))
+
+;; Note that this extension also defines %make-transcoded-port, which is
+;; not exported but is used by (rnrs io ports).
+
+(load-extension (string-append "libguile-" (effective-version))
+                "scm_init_r6rs_ports")
diff --git a/module/language/assembly/compile-bytecode.scm 
b/module/language/assembly/compile-bytecode.scm
index 02695d7..ae64768 100644
--- a/module/language/assembly/compile-bytecode.scm
+++ b/module/language/assembly/compile-bytecode.scm
@@ -24,11 +24,15 @@
   #:use-module (system vm instruction)
   #:use-module (srfi srfi-4)
   #:use-module (rnrs bytevectors)
-  #:use-module (rnrs io ports)
+  #:use-module (ice-9 binary-ports)
   #:use-module ((srfi srfi-1) #:select (fold))
   #:use-module ((srfi srfi-26) #:select (cut))
   #:export (compile-bytecode))
 
+;; Gross.
+(define (port-position port)
+  (seek port 0 SEEK_CUR))
+
 (define (compile-bytecode assembly env . opts)
   (pmatch assembly
     ((load-program . _)
diff --git a/module/language/elisp/lexer.scm b/module/language/elisp/lexer.scm
index ed6c5f8..af7e02a 100644
--- a/module/language/elisp/lexer.scm
+++ b/module/language/elisp/lexer.scm
@@ -394,7 +394,7 @@
         (paren-level 0))
     (lambda ()
       (if finished
-          (cons 'eof ((@ (rnrs io ports) eof-object)))
+          (cons 'eof ((@ (ice-9 binary-ports) eof-object)))
           (let ((next (lex))
                 (quotation #f))
             (case (car next)
diff --git a/module/rnrs/io/ports.scm b/module/rnrs/io/ports.scm
index a5815c8..d3a81b7 100644
--- a/module/rnrs/io/ports.scm
+++ b/module/rnrs/io/ports.scm
@@ -98,7 +98,8 @@
           make-i/o-decoding-error
           &i/o-encoding-error i/o-encoding-error?
           make-i/o-encoding-error i/o-encoding-error-char)
-  (import (only (rnrs base) assertion-violation)
+  (import (ice-9 binary-ports)
+          (only (rnrs base) assertion-violation)
           (rnrs enums)
           (rnrs records syntactic)
           (rnrs exceptions)
@@ -108,9 +109,6 @@
           (ice-9 rdelim)
           (except (guile) raise))
 
-(load-extension (string-append "libguile-" (effective-version))
-                "scm_init_r6rs_ports")
-
 
 
 ;;;
@@ -205,7 +203,8 @@
   "Return a new textual port based on @var{port}, using
 @var{transcoder} to encode and decode data written to or
 read from its underlying binary port @var{port}."
-  (let ((result (%make-transcoded-port port)))
+  ;; Hackily get at %make-transcoded-port.
+  (let ((result ((@@ (ice-9 binary-ports) %make-transcoded-port) port)))
     (set-port-encoding! result (transcoder-codec transcoder))
     (case (transcoder-error-handling-mode transcoder)
       ((raise)
diff --git a/module/web/request.scm b/module/web/request.scm
index 91cc59d..8411920 100644
--- a/module/web/request.scm
+++ b/module/web/request.scm
@@ -21,7 +21,7 @@
 
 (define-module (web request)
   #:use-module (rnrs bytevectors)
-  #:use-module (rnrs io ports)
+  #:use-module (ice-9 binary-ports)
   #:use-module (ice-9 rdelim)
   #:use-module (srfi srfi-9)
   #:use-module (web uri)
diff --git a/module/web/response.scm b/module/web/response.scm
index 2cabd4f..6283772 100644
--- a/module/web/response.scm
+++ b/module/web/response.scm
@@ -21,7 +21,7 @@
 
 (define-module (web response)
   #:use-module (rnrs bytevectors)
-  #:use-module (rnrs io ports)
+  #:use-module (ice-9 binary-ports)
   #:use-module (ice-9 rdelim)
   #:use-module (srfi srfi-9)
   #:use-module (web http)
diff --git a/module/web/server.scm b/module/web/server.scm
index 4715cae..8dbd139 100644
--- a/module/web/server.scm
+++ b/module/web/server.scm
@@ -75,7 +75,7 @@
 (define-module (web server)
   #:use-module (srfi srfi-9)
   #:use-module (rnrs bytevectors)
-  #:use-module (rnrs io ports)
+  #:use-module (ice-9 binary-ports)
   #:use-module (web request)
   #:use-module (web response)
   #:use-module (system repl error-handling)
diff --git a/module/web/uri.scm b/module/web/uri.scm
index 2361d87..23699e9 100644
--- a/module/web/uri.scm
+++ b/module/web/uri.scm
@@ -30,7 +30,7 @@
   #:use-module (ice-9 rdelim)
   #:use-module (ice-9 control)
   #:use-module (rnrs bytevectors)
-  #:use-module (rnrs io ports)
+  #:use-module (ice-9 binary-ports)
   #:export (uri?
             uri-scheme uri-userinfo uri-host uri-port
             uri-path uri-query uri-fragment


hooks/post-receive
-- 
GNU Guile



reply via email to

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