Skip to content

Commit

Permalink
Merge pull request #472 from tie-rack/normalize-io-docstrings
Browse files Browse the repository at this point in the history
Normalize docstrings in io-related namespaces
  • Loading branch information
thomasmulvaney committed Dec 12, 2015
2 parents a47cc3e + 5fa954e commit 189395f
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
10 changes: 5 additions & 5 deletions pixie/io-blocking.pxi
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,15 @@
(common/stream-reducer this f init)))

(defn open-read
{:doc "Open a file for reading, returning a IInputStream"
{:doc "Opens a file for reading. Returns an IInputStream."
:added "0.1"}
[filename]
(assert (string? filename) "Filename must be a string")
(->FileStream (fopen filename "r")))

(defn read-line
"Read one line from input-stream for each invocation.
nil when all lines have been read"
"Reads one line from input-stream for each invocation.
Returns nil when all lines have been read."
[input-stream]
(let [line-feed (into #{} (map int [\newline \return]))
buf (buffer 1)]
Expand All @@ -62,7 +62,7 @@

(defn line-seq
"Returns the lines of text from input-stream as a lazy sequence of strings.
input-stream must implement IInputStream"
input-stream must implement IInputStream."
[input-stream]
(when-let [line (read-line input-stream)]
(cons line (lazy-seq (line-seq input-stream)))))
Expand Down Expand Up @@ -131,7 +131,7 @@
(common/stream-reducer this f init)))

(defn popen-read
{:doc "Open a file for reading, returning a IInputStream"
{:doc "Opens a file for reading. Returns an IInputStream."
:added "0.1"}
[command]
(assert (string? command) "Command must be a string")
Expand Down
14 changes: 7 additions & 7 deletions pixie/io.pxi
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
(common/stream-reducer this f init)))

(defn open-read
{:doc "Open a file for reading, returning a IInputStream"
{:doc "Opens a file for reading. Returns an IInputStream."
:added "0.1"}
[filename]
(assert (string? filename) "Filename must be a string")
Expand Down Expand Up @@ -95,15 +95,15 @@
(throw [::Exception "Expected a LineReader, UTF8InputStream, or BufferedInputStream"])))

(defn read-line
"Read one line from input-stream for each invocation.
nil when all lines have been read.
"Reads one line from input-stream for each invocation.
Returns nil when all lines have been read.
Pass a BufferedInputStream for best performance."
[input-stream]
(-read-line (line-reader input-stream)))

(defn line-seq
"Returns the lines of text from input-stream as a lazy sequence of strings.
input-stream must implement IInputStream"
input-stream must implement IInputStream."
[input-stream]
(let [lr (line-reader input-stream)]
(when-let [line (-read-line lr)]
Expand Down Expand Up @@ -213,7 +213,7 @@
result)

(defn open-write
{:doc "Open a file for writing, returning a IOutputStream"
{:doc "Opens a file for writing. Returns an IOutputStream."
:added "0.1"}
[filename]
(assert (string? filename) "Filename must be a string")
Expand Down Expand Up @@ -244,8 +244,8 @@

:else (throw [::Exception "Expected a string or IOutputStream"])))

(defn slurp
"Reads in the contents of input. Input must be a filename or an IInputStream"
(defn slurp
"Reads in the contents of input. Input must be a filename or an IInputStream."
[input]
(let [stream (cond
(string? input) (open-read input)
Expand Down
2 changes: 1 addition & 1 deletion pixie/io/tcp.pxi
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@


(defn tcp-client
"Creates a TCP connection to the given ip (as a string) and port (an integer). Will return a TCPStream"
"Creates a TCP connection to the given ip (as a string) and port (an integer). Returns a TCPStream."
[ip port]
(let [client-addr (uv/sockaddr_in)
uv-connect (uv/uv_connect_t)
Expand Down

0 comments on commit 189395f

Please sign in to comment.