From 575a02d3fa1eb61ff3798593651f37f7226d1f6b Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Wed, 27 Apr 2016 11:13:37 -0700 Subject: [PATCH] add documentation for some stream macros --- CHANGES/streams | 8 ++++++++ arc.arc | 1 + 2 files changed, 9 insertions(+) create mode 100644 CHANGES/streams diff --git a/CHANGES/streams b/CHANGES/streams new file mode 100644 index 000000000..e24d00cb7 --- /dev/null +++ b/CHANGES/streams @@ -0,0 +1,8 @@ +Arc Streams (based on Racket Ports: https://docs.racket-lang.org/reference/ports.html) +are for dealing with sources and sinks to data, whether backed by files, +sockets or just in-memory strings. + +In addition to the Arc 3.1 primitives for streams documented at +https://arclanguage.github.io/ref/io.html, Anarki provides several macros that +help in some common situations: `fromfile`, `tofile`, `ontofile` and +`reading`. Read more about them using the `help` command. diff --git a/arc.arc b/arc.arc index 675aaed53..a26f19f51 100644 --- a/arc.arc +++ b/arc.arc @@ -1537,6 +1537,7 @@ nothing to read. Caller is responsible for picking an unambiguous 'eof' indicato `(ifread-fn ,port (fn (,var) ,then) (fn () ,else))) (mac reading (var port . body) +"Call (read) on a port, store the result in `var`, and do something with it." `(ifread ,var ,port (do ,@body))) (mac fromfile (f . body)