Skip to content

Commit

Permalink
add documentation for some stream macros
Browse files Browse the repository at this point in the history
  • Loading branch information
akkartik committed Apr 27, 2016
1 parent df0b876 commit 575a02d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
8 changes: 8 additions & 0 deletions 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.
1 change: 1 addition & 0 deletions arc.arc
Expand Up @@ -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)
Expand Down

0 comments on commit 575a02d

Please sign in to comment.