Access denied with clojure.java.io/copy

2012-07-08 Thread Pierre-Henry Perret
Using *clojure.java.io/copy *I get the following output: ___ Exception in thread "main" java.io.FileNotFoundException: .lein-git-deps\project\cljs-src (Access denied) (NO_SOURCE_FILE:0 The sources files are in *lein-git-deps\project\cljs-sr *and destination in a *s

Re: mutual reference in FP style

2012-07-08 Thread Timo Mihaljov
On 07/06/2012 09:54 PM, Mark Engelberg wrote: > You basically have two choices. > > Choice 1, give names to each of your nodes, and link names to names. > (def cycle {:a {:value 2, :link :b}, :b {:value 3, :link :a}} > > Choice 2, use one of Clojure's reference types > (def a (ref {:value 2})) >

Re: mutual reference in FP style

2012-07-08 Thread Timo Mihaljov
On 07/08/2012 01:37 PM, Timo Mihaljov wrote: > I think promises are a great fit for this use case, as the result is > immutable. I should have read the original question more closely. Promises are great for mutual references in static graphs, but updating parts of the graph will be easier with the

Using clojure-csv with large files

2012-07-08 Thread Timothy Washington
Hi there, I'm trying out the Clojure-csvlib. But I run out of heap space when trying to parse a large CSV file. So this call should return a lazy sequence. (csv/parse-csv (io/reader "*125Mfile.csv*")) Instead, I get a "*java.lang.OutOfMemoryError:

Re: critique my code!

2012-07-08 Thread William Morgan
Excerpts from Alex Robbins's message of 2012-07-06 05:27:28 -0700: > Reading through your code, many of your functions have large cond or > condp clauses. Sometimes those can be replaced with multimethods. Thanks, that's good to know. I think in this case the large condp switches are part and parc

Re: Using clojure-csv with large files

2012-07-08 Thread Denis Labaye
Hi, I would try something like (untested): (map parse-csv (line-seq (clojure.java.io/reader "/tmp/foo.csv"))) But it will break for CSV cells with newlines like: a ; b foo;"bar baz" x ; z interesting ... Denis On Sun, Jul 8, 2012 at 6:34 PM, Timothy Washington wrote: > Hi there, > >

Re: Using clojure-csv with large files

2012-07-08 Thread David Santiago
Yeah, CSV files can have embedded newlines, so you can't just split it up on linebreaks and expect it to work, you need to send them through a parser. parse-csv *is* lazy, so my question is, are you doing this at the repl, exactly as you wrote? If so, it will lazily parse the file, and then print

Can I examine the state of a Clojure lazy sequence?

2012-07-08 Thread Larry Travis
(1) Is there any way I can extract from a Clojure lazy sequence at some given point in its use those of its members that have so far been realized? For example, can I extract the cache of realized members, turn it into a vector, and then process that vector independently of further use of the l

Re: Using clojure-csv with large files

2012-07-08 Thread Sean Corfield
On Sun, Jul 8, 2012 at 9:34 AM, Timothy Washington wrote: > I'm trying out the Clojure-csv lib. But I run out of heap space when trying > to parse a large CSV file. So this call should return a lazy sequence. > > (csv/parse-csv (io/reader "125Mfile.csv")) If you are consuming the CSV lazily, you

Re: POST not working with compojure 1.1.0 and ring-jetty-adapter 1.1.0

2012-07-08 Thread ArturoH
Worked like a charm, thank you James On Saturday, July 7, 2012 5:42:43 PM UTC-5, James Reeves wrote: > > On 7 July 2012 23:24, ArturoH wrote: > > I'm not sure that I am having a version problem but this very simple > example > > does not work for me. I get the POST form but when I subit the PO

Re: Using clojure-csv with large files

2012-07-08 Thread Dustin Getz
what are you doing with the return value of csv/parse-csv? -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your firs

[ANN] timing is a timing library for clojure

2012-07-08 Thread Sun Ning
Hi, I just worked on timing clojure function calls. As you know, the built-in (time) macro is pretty good. But there's even better solutions in Java, called perf4j. perf4j logs call time with a configurable logger. And you can use log4j appenders to aggregate the data into some sorts of reports

Re: Using clojure-csv with large files

2012-07-08 Thread Timothy Washington
Hmm, these are all good points. My source file just returns the sequence (as in *src.clj*). I have a midje test file (*test.clj*) that just asserts that it exists. *src.clj * (ns my-ns ... ) (defn load-config [] (let [config (load-file "etc/config.clj") dname (-> config :data :test)]

Re: Can I examine the state of a Clojure lazy sequence?

2012-07-08 Thread Tassilo Horn
Larry Travis writes: Hi Larry, > (1) Is there any way I can extract from a Clojure lazy sequence at > some given point in its use those of its members that have so far been > realized? For example, can I extract the cache of realized members, > turn it into a vector, and then process that vector