On Jan 18, 10:55 pm, Tom Hicks wrote:
> Hey, congratulations on finding and fixing the problem!
>
> And thanks for the great link to the zipper explanationzippers
> were
> at the top of my list to learn (seriously). Did you catch this other
> useful
> link (in the comments of the article you p
Hey, congratulations on finding and fixing the problem!
And thanks for the great link to the zipper explanationzippers
were
at the top of my list to learn (seriously). Did you catch this other
useful
link (in the comments of the article you provided)?
http://okmij.org/ftp/Computation/Continua
I've now changed my test method to this.
(def pit (iterate list "bottom!"))
(defn get-bottom [p]
(loop [p (first p)]
(if (seq? p) (recur (first p)) p)))
(defn test-walk [walker shallowest deepest]
(doseq [depth (range shallowest deepest)]
(println (get-bottom
(walker #
I've found the real problem. The overflow was coming from recursion
between pr-on and print-method. It must be that way because it's not
really useful to print such deeply nested data structure anyway.
On Jan 18, 7:06 pm, Nicolas Buduroi wrote:
> On Jan 16, 7:33 pm, Laurent PETIT wrote:
>
> > Fo
On Jan 16, 7:33 pm, Laurent PETIT wrote:
> For the non lazy version , maybe using clojure.zip would help not blow
> up the stack ?
>
> (using clojure.zip/zip + a loop with recur on clojure.zip/next) ?
I've just tried it and it appears to be equivalent to the lazy walk
version, which I think is fu
> Sorry, I forgot to ask: how rapid is "rapidly"?
Oh, I'd say I misused that word, at least it's way more than I need
for what I use this for. I created this post only to see if someone
would have an idea for a fully lazy version out of curiosity. From my
experiments, the non-recursive version blo
On Jan 15, 1:21 pm, Nicolas Buduroi wrote:
> Hi, I'm still not familiar with laziness and I'm trying to make a
> function recursively walk arbitrary data structures to perform some
> action on all strings.
> ...
> Is there a way too make a fully lazy version of this function?
>
> - budu
I'm tryin
On Jan 15, 1:21 pm, Nicolas Buduroi wrote:
> Hi, I'm still not familiar with laziness and I'm trying to make a
> function recursively walk arbitrary data structures to perform some
> action on all strings. The non-lazy version is quite easy to do:
>
> (use
> 'clojure.walk
> 'clojure.contrib.st
Sorry, I forgot to ask: how rapid is "rapidly"?
Can you provide a simple example that rapidly blows the stack
so we can experiment with lazy solutions?
-tom
On Jan 15, 1:21 pm, Nicolas Buduroi wrote:
>
> But it blow up the stack quite rapidly, ...
> ...
> - budu
--
You received this mes
On Jan 15, 1:44 pm, Nicolas Buduroi wrote:
> On Jan 15, 3:25 pm, Sean Devlin wrote:
>
> > Did you try wrapping everything w/ a call to lazy-seq?
>
> Yes, it doesn't seem change anything.
I suspect that just wrapping everything in a call to lazy-seq cannot
work
in this case. In the implementatio
For the non lazy version , maybe using clojure.zip would help not blow
up the stack ?
(using clojure.zip/zip + a loop with recur on clojure.zip/next) ?
2010/1/15 Nicolas Buduroi :
> Hi, I'm still not familiar with laziness and I'm trying to make a
> function recursively walk arbitrary data struct
On Jan 15, 3:25 pm, Sean Devlin wrote:
> Did you try wrapping everything w/ a call to lazy-seq?
Yes, it doesn't seem change anything.
--
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
Did you try wrapping everything w/ a call to lazy-seq?
On Jan 15, 3:21 pm, Nicolas Buduroi wrote:
> Hi, I'm still not familiar with laziness and I'm trying to make a
> function recursively walk arbitrary data structures to perform some
> action on all strings. The non-lazy version is quite easy t
Hi, I'm still not familiar with laziness and I'm trying to make a
function recursively walk arbitrary data structures to perform some
action on all strings. The non-lazy version is quite easy to do:
(use
'clojure.walk
'clojure.contrib.str-utils)
(defn recursive-string-walk [f form]
(walk #(
14 matches
Mail list logo