From 7f2bce01309368ce4446b573b324f8ea1e981cf5 Mon Sep 17 00:00:00 2001 From: Matthias Felleisen Date: Thu, 31 Dec 2009 14:50:47 +0000 Subject: [PATCH] added with-in/out from/to string for Bloch svn: r17453 --- collects/lang/private/advanced-funs.ss | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/collects/lang/private/advanced-funs.ss b/collects/lang/private/advanced-funs.ss index 21830fac94..467614089a 100644 --- a/collects/lang/private/advanced-funs.ss +++ b/collects/lang/private/advanced-funs.ss @@ -5,6 +5,7 @@ mzlib/pretty syntax/docprovide scheme/promise + scheme/port "../posn.ss" (for-syntax scheme/base)) @@ -12,6 +13,16 @@ procedures ("Reading and Printing" + (with-input-from-file (string (-> any) -> any) + "to open the named input file and to extract all input from there") + (with-output-to-file (string (-> any) -> any) + "to open the named output file and to put all output there") + (with-input-from-string (string (-> any) -> any) + "to turn the given string into input for read* operations") + (with-output-to-string (string (-> any) -> any) + "to produce a string from all write/display/print operations") + + (print (any -> void) "to print the argument as a value to stdout") (display (any -> void) @@ -53,11 +64,6 @@ (current-milliseconds (-> exact-integer) "to return the current “time” in fixnum milliseconds (possibly negative)") - (with-input-from-file (string (-> any) -> any) - "to open the given string as an input file and to make it the current input port") - (with-output-to-file (string (-> any) -> any) - "to open the given string as an output file and to make it the current output port") - (force (delay -> any) "to find the delayed value; see also delay") (promise? (any -> boolean) "to determine if a value is delayed") (void (-> void) "produces a void value")