From 14847f7800a477544df8ea16bf5fec1d9ceddea0 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Wed, 9 Aug 2023 22:00:31 -0500 Subject: Add with-{input-from,output-to}-string Inspired by CHICKEN --- README.md | 2 ++ 1 file changed, 2 insertions(+) (limited to 'README.md') diff --git a/README.md b/README.md index c8b1fcd..c275ffb 100644 --- a/README.md +++ b/README.md @@ -34,6 +34,8 @@ Other extras include - `(read-port)`, `(read-port port)` reads a port until hitting end-of-file (IDK why this isn't in R7RS!), in chunks of `read-port-chunk-size` - `(defined? x)` returns whether the symbol `x` is bound to a variable +- `(with-input-from-string str thunk)` calls `thunk` with `str` bound as the current-input-port. +- `(with-output-to-string thunk)` calls `thunk` and returns a string of the output. - `(displayed x)`, `(->string x)` returns `x` as a string (via `display`) - `(written x)` returns `x` as a string (via `write`) - `(print x ...)` displays `x ...` followed by a newline -- cgit 1.4.1-21-gabe81