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=c399333044640cc2919aa535784cfa3a26901b95 The branch, master has been updated via c399333044640cc2919aa535784cfa3a26901b95 (commit) from 00f79aa4a0953f2f7348aa20f09b34fda257df32 (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 c399333044640cc2919aa535784cfa3a26901b95 Author: Andy Wingo <wi...@pobox.com> Date: Fri Jun 18 19:27:52 2010 +0200 add open-string-{input,output}-port to rnrs io ports * module/rnrs/io/ports.scm (open-string-input-port) (open-string-output-port): New procedures. * module/rnrs.scm (rnrs): Export the new (rnrs io ports) procedures. ----------------------------------------------------------------------- Summary of changes: module/rnrs.scm | 1 + module/rnrs/io/ports.scm | 13 +++++++++++++ 2 files changed, 14 insertions(+), 0 deletions(-) diff --git a/module/rnrs.scm b/module/rnrs.scm index 83fad98..5df53fe 100644 --- a/module/rnrs.scm +++ b/module/rnrs.scm @@ -167,6 +167,7 @@ lookahead-u8 get-bytevector-n get-bytevector-n! get-bytevector-some get-bytevector-all open-bytevector-output-port make-custom-binary-output-port put-u8 put-bytevector + open-string-input-port open-string-output-port ;; (rnrs io simple) diff --git a/module/rnrs/io/ports.scm b/module/rnrs/io/ports.scm index 89dc265..4916bba 100644 --- a/module/rnrs/io/ports.scm +++ b/module/rnrs/io/ports.scm @@ -39,6 +39,7 @@ ;; input ports open-bytevector-input-port + open-string-input-port make-custom-binary-input-port ;; binary input @@ -48,6 +49,7 @@ ;; output ports open-bytevector-output-port + open-string-output-port make-custom-binary-output-port ;; binary output @@ -106,4 +108,15 @@ read from/written to in @var{port}." (lambda () (close-port port)))) +(define (open-string-input-port str) + "Open an input port that will read from @var{str}." + (open-input-string str)) + +(define (open-string-output-port) + "Return two values: an output port that will collect characters written to it +as a string, and a thunk to retrieve the characters associated with that port." + (let ((port (open-output-string))) + (values port + (lambda () (get-output-string port))))) + ;;; ports.scm ends here hooks/post-receive -- GNU Guile