On Mon, Jan 9, 2012 at 7:48 AM, Matthew Giannini
wrote:
> Cedric - thanks. I'm new to Clojure and after posting this realized that I
> could/should use one of the do* approaches. I ended up using doseq and it
> worked great.
>
> Thanks.
You're welcome.
--
You received this message because you a
Cedric - thanks. I'm new to Clojure and after posting this realized that I
could/should use one of the do* approaches. I ended up using doseq and it
worked great.
Thanks.
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send e
On Fri, Jan 6, 2012 at 9:25 AM, Matthew wrote:
> (defn id3-encode
> ([] (id3-encode test-out))
> ([file]
> (with-open [out (-> (File. file) (FileOutputStream.)
> (BufferedOutputStream.) (DataOutputStream.))]
> (binding [*out* out]
> (map #(write-a :byte %) [\I \D \3])
>
> When
I have the following code (very simple) for writing some binary data
to a file
(def ^{:dynamic true} *out*)
;; writers
(defmulti write-a
(fn [spec val]
(cond
(keyword? spec) spec)))
(defmethod write-a :byte [_ val]
(.writeByte *out* (int val)))
And this code to write to the dynami