From d130b592795c0fa7451652caca90d4fd320a9b44 Mon Sep 17 00:00:00 2001 From: Chris Hanson Date: Mon, 9 Aug 1999 18:12:11 +0000 Subject: [PATCH] Add new procedure WRITE-SUBSTRING. --- v7/doc/ref-manual/scheme.texinfo | 11 ++++++++++- v7/src/runtime/output.scm | 10 +++++++++- v7/src/runtime/runtime.pkg | 5 +++-- v8/src/runtime/runtime.pkg | 5 +++-- 4 files changed, 25 insertions(+), 6 deletions(-) diff --git a/v7/doc/ref-manual/scheme.texinfo b/v7/doc/ref-manual/scheme.texinfo index b531b9bb4..aa4a9203f 100644 --- a/v7/doc/ref-manual/scheme.texinfo +++ b/v7/doc/ref-manual/scheme.texinfo @@ -2,7 +2,7 @@ @iftex @finalout @end iftex -@comment $Id: scheme.texinfo,v 1.74 1999/08/04 01:42:54 cph Exp $ +@comment $Id: scheme.texinfo,v 1.75 1999/08/09 18:12:11 cph Exp $ @comment %**start of header (This is for running Texinfo on a region.) @setfilename scheme.info @settitle MIT Scheme Reference @@ -12525,6 +12525,15 @@ writing the contents of @var{string}, one character at a time using @code{write-char}, except that it is usually much faster. @end deffn +@deffn {procedure+} write-substring string start end [output-port] +@cindex string, output to port +Writes the substring defined by @var{string}, @var{start}, and @var{end} +to @var{output-port}, performs discretionary output flushing, and +returns an unspecified value. This is equivalent to writing the +contents of the substring, one character at a time using +@code{write-char}, except that it is usually much faster. +@end deffn + @deffn procedure write object [output-port] @cindex expression, output to port Writes a written representation of @var{object} to @var{output-port}, diff --git a/v7/src/runtime/output.scm b/v7/src/runtime/output.scm index f43234312..34386ccaf 100644 --- a/v7/src/runtime/output.scm +++ b/v7/src/runtime/output.scm @@ -1,6 +1,6 @@ #| -*-Scheme-*- -$Id: output.scm,v 14.19 1999/02/16 19:44:51 cph Exp $ +$Id: output.scm,v 14.20 1999/08/09 18:10:38 cph Exp $ Copyright (c) 1988-1999 Massachusetts Institute of Technology @@ -92,6 +92,14 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. (output-port/write-string port string) (output-port/discretionary-flush port))) +(define (write-substring string start end #!optional port) + (let ((port + (if (default-object? port) + (current-output-port) + (guarantee-output-port port)))) + (output-port/write-string port string start end) + (output-port/discretionary-flush port))) + (define (wrap-custom-operation-0 operation-name) (lambda (#!optional port) (let ((port diff --git a/v7/src/runtime/runtime.pkg b/v7/src/runtime/runtime.pkg index afb5f1b84..255dfac42 100644 --- a/v7/src/runtime/runtime.pkg +++ b/v7/src/runtime/runtime.pkg @@ -1,6 +1,6 @@ #| -*-Scheme-*- -$Id: runtime.pkg,v 14.329 1999/06/21 03:47:29 cph Exp $ +$Id: runtime.pkg,v 14.330 1999/08/09 18:10:41 cph Exp $ Copyright (c) 1988-1999 Massachusetts Institute of Technology @@ -1223,7 +1223,8 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. write write-char write-line - write-string)) + write-string + write-substring)) (define-package (runtime interrupt-handler) (files "intrpt") diff --git a/v8/src/runtime/runtime.pkg b/v8/src/runtime/runtime.pkg index f41b92352..c3094c194 100644 --- a/v8/src/runtime/runtime.pkg +++ b/v8/src/runtime/runtime.pkg @@ -1,6 +1,6 @@ #| -*-Scheme-*- -$Id: runtime.pkg,v 14.334 1999/06/21 03:47:25 cph Exp $ +$Id: runtime.pkg,v 14.335 1999/08/09 18:10:44 cph Exp $ Copyright (c) 1988-1999 Massachusetts Institute of Technology @@ -1227,7 +1227,8 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. write write-char write-line - write-string)) + write-string + write-substring)) (define-package (runtime interrupt-handler) (files "intrpt") -- 2.25.1