Re: Better/more idiomatic way to read EDNs than using java.io.PushbackReader

2015-03-08 Thread Matthew Boston
I've done something like: (clojure.edn/read-string (slurp (clojure.java.io/resource edn-file))) This of course assumes the file resides in `/resources`. On Friday, March 6, 2015 at 8:18:03 PM UTC-7, Sam Raker wrote: > > I'm experimenting a little with EDN files. I've currently got this > functi

Re: Better/more idiomatic way to read EDNs than using java.io.PushbackReader

2015-03-07 Thread Matching Socks
Vote for "clojure.java.io/pushback-reader" http://dev.clojure.org/jira/browse/CLJ-1611 ? That enhancement suggestion contains links to some previous discussions on the subject. On Friday, March 6, 2015 at 10:18:03 PM UTC-5, Sam Raker wrote: > > I'm experimenting a little with EDN files. I've

Re: Better/more idiomatic way to read EDNs than using java.io.PushbackReader

2015-03-06 Thread Mark Mandel
Totally off the top of my head, but this should work - (edn/read-string (join " " (line-seq r))) Mark On 7 March 2015 at 14:18, Sam Raker wrote: > I'm experimenting a little with EDN files. I've currently got this > function: > > (defn from-edn [edn-file] (with-open [r (clojure.java.io/reader

Better/more idiomatic way to read EDNs than using java.io.PushbackReader

2015-03-06 Thread Sam Raker
I'm experimenting a little with EDN files. I've currently got this function: (defn from-edn [edn-file] (with-open [r (clojure.java.io/reader edn-file)] (edn/read (java.io.PushbackReader. r Having to explicitly reach into the Java API to read a clojure-only format