diff options
author | Chouser <chouser@n01se.net> | 2008-07-24 20:43:19 +0000 |
---|---|---|
committer | Chouser <chouser@n01se.net> | 2008-07-24 20:43:19 +0000 |
commit | 481099e3e30c02e89630fa19b855e958099c4eff (patch) | |
tree | 080d79732dc30926cf8e57b3928e382b2c746c5c | |
parent | 6ef0bd37350c2b4f240b049604fc9a473445cca0 (diff) |
Add type hints.
-rw-r--r-- | duck-streams.clj | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/duck-streams.clj b/duck-streams.clj index df74fd3e..5c6cba09 100644 --- a/duck-streams.clj +++ b/duck-streams.clj @@ -86,7 +86,7 @@ [x] (cond (instance? PrintWriter x) x - (instance? BufferedWriter x) (new PrintWriter x) + (instance? BufferedWriter x) (new PrintWriter #^BufferedWriter x) (instance? Writer x) (bufw x) ; includes FileWriter (instance? OutputStream x) (bufw (new OutputStreamWriter x)) (instance? File x) (bufw (new FileWriter #^File x)) @@ -104,7 +104,7 @@ (defn write-lines "Opposite of 'line-seq'. Writes lines (a seq) to writer (an open java.io.PrintWriter), separated by newlines." - [writer lines] + [#^PrintWriter writer lines] (let [line (first lines)] (when line (. writer (write (str line))) @@ -115,6 +115,6 @@ "Opposite of 'slurp'. Writes 'contents' to the file named by 'filename'." [filename contents] - (with-open w (writer filename) + (with-open w (#^PrintWriter writer filename) (. w (print contents)))) |