From: Chris Hanson Date: Wed, 21 Jun 2006 03:00:11 +0000 (+0000) Subject: Define CALL-WITH-INPUT-STRING, since I keep assuming it's there. X-Git-Tag: 20090517-FFI~1000 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=904168820bb727d2ab26e978cf654bd59deb3f7b;p=mit-scheme.git Define CALL-WITH-INPUT-STRING, since I keep assuming it's there. --- diff --git a/v7/src/runtime/runtime.pkg b/v7/src/runtime/runtime.pkg index 8bfc0a18d..298bc138e 100644 --- a/v7/src/runtime/runtime.pkg +++ b/v7/src/runtime/runtime.pkg @@ -1,6 +1,6 @@ #| -*-Scheme-*- -$Id: runtime.pkg,v 14.585 2006/06/12 17:53:11 cph Exp $ +$Id: runtime.pkg,v 14.586 2006/06/21 03:00:05 cph Exp $ Copyright 1988,1989,1990,1991,1992,1993 Massachusetts Institute of Technology Copyright 1994,1995,1996,1997,1998,1999 Massachusetts Institute of Technology @@ -4043,6 +4043,7 @@ USA. (files "strnin") (parent (runtime)) (export () + call-with-input-string open-input-string (string->input-port open-input-string) with-input-from-string) diff --git a/v7/src/runtime/strnin.scm b/v7/src/runtime/strnin.scm index 2c424c66b..ea6c9a390 100644 --- a/v7/src/runtime/strnin.scm +++ b/v7/src/runtime/strnin.scm @@ -1,9 +1,9 @@ #| -*-Scheme-*- -$Id: strnin.scm,v 14.17 2005/12/20 15:53:04 cph Exp $ +$Id: strnin.scm,v 14.18 2006/06/21 03:00:11 cph Exp $ Copyright 1988,1990,1993,1999,2003,2004 Massachusetts Institute of Technology -Copyright 2005 Massachusetts Institute of Technology +Copyright 2005,2006 Massachusetts Institute of Technology This file is part of MIT/GNU Scheme. @@ -49,6 +49,12 @@ USA. 'ISO-8859-1 'NEWLINE)))) +(define (call-with-input-string string procedure) + (let ((port (open-input-string string))) + (let ((value (procedure port))) + (close-input-port port) + value))) + (define (make-string-source string start end) (let ((index start)) (make-non-channel-source