Re: Print a Large Lazy Seq - Heap Error

2009-04-02 Thread fitzpatrick...@googlemail.com
That did it! I just used the functions that created my-row-data in place of my-row-data. Thanks very much for the help. PJ On Apr 2, 1:34 pm, Laurent PETIT wrote: > Difficult without seeing the code. > > the idea is to try not storing what is currently in my-row-data anywhere. > > So if you can

Re: Print a Large Lazy Seq - Heap Error

2009-04-02 Thread Laurent PETIT
Difficult without seeing the code. the idea is to try not storing what is currently in my-row-data anywhere. So if you can create a function that returns what is currently stored in my-row-data, and pass that function to your function t, then the head of your sequence will not be retained in any

Re: Print a Large Lazy Seq - Heap Error

2009-04-02 Thread fitzpatrick...@googlemail.com
Apologies for my ignorance ,i am new to clojure, but can you give an example of what the code should look like. I understand my-row-data is lexical as it defined outside the function but i don't understand how to implement this new function. tks, PJ On Apr 2, 1:03 pm, Laurent PETIT wrote: > You'

Re: Print a Large Lazy Seq - Heap Error

2009-04-02 Thread Laurent PETIT
You're holding the head, because my-row-data is defined in the lexical or dynamic scope of the function, and holds the head. Try creating a function returning the seq that is currently stored in my-row-data and call it instead : (my-row-data) -- Laurent 2009/4/2 fitzpatrick...@googlemail.com

Re: Print a Large Lazy Seq - Heap Error

2009-04-02 Thread fitzpatrick...@googlemail.com
Hi, Thanks for the replies. I have adapted the code above with my example. I still get the heap error! my-row-data is the lazy sequence. each element in the seq is a 2 element vector of Java String[] output-array is just a printing function for the String[]. For convenience i place a @ between th

Re: Print a Large Lazy Seq - Heap Error

2009-04-02 Thread Christian Vest Hansen
On Thu, Apr 2, 2009 at 11:58 AM, fitzpatrick...@googlemail.com wrote: > > Hi, > I am attempting to print a large lazy seq to file. I have attempted > various approaches and obviously am missing something obvious. > I have attempted do use do-seq and also iterated manually through the > sequence b

Re: Print a Large Lazy Seq - Heap Error

2009-04-02 Thread Laurent PETIT
e.g. the following code works very well for me (so I had to stop it before the file size became > to 1 Gbyte :-) : ;; file test.clj (ns test) (defn infinite [] (repeat "a line")) (defn t [] (with-open [w (java.io.FileWriter. (java.io.File. "/tmp/test"))] (doseq [l (infinite)]

Re: Print a Large Lazy Seq - Heap Error

2009-04-02 Thread Laurent PETIT
Can you post the code that poses problem ? 2009/4/2 fitzpatrick...@googlemail.com > > Hi, > I am attempting to print a large lazy seq to file. I have attempted > various approaches and obviously am missing something obvious. > I have attempted do use do-seq and also iterated manually through the

Print a Large Lazy Seq - Heap Error

2009-04-02 Thread fitzpatrick...@googlemail.com
Hi, I am attempting to print a large lazy seq to file. I have attempted various approaches and obviously am missing something obvious. I have attempted do use do-seq and also iterated manually through the sequence but i always come up with the heap error. Has anyone got any suggestions? tks, PJ --