Re: Help with binding

2012-01-09 Thread Cedric Greevey
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

Re: Help with binding

2012-01-09 Thread Matthew Giannini
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

Re: Help with binding

2012-01-08 Thread Cedric Greevey
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

Help with binding

2012-01-08 Thread Matthew
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