Hi,

I changed println to z/node , this time I'm getting:

NullPointerException   clojure.zip/branch? (zip.clj:73)

On Friday, August 21, 2015 at 5:56:10 PM UTC+2, Moe Aboulkheir wrote:
>
> Hussein, 
>
> The println inside (recur) will return nil. 
>
> Take care, 
> Moe 
>
> On Fri, Aug 21, 2015 at 4:35 PM, Hussein B. <hubag...@gmail.com 
> <javascript:>> wrote: 
> > Hi, 
> > 
> > I have this structure: 
> > 
> > (def s [{"n" {"id" "a"} "d" 2 "children" [{"n" {"id" "c"} "d" 4 
> "children" 
> > []}]} {"n" {"id" "b"} "d" 3 "children" []}]) 
> > 
> > 
> > 
> > And I wrote a function with zippers to traverse it: 
> > 
> >  (defn traverse [col] 
> >   (loop [z col] 
> >     (if (= (z/next z) z) 
> >     z 
> >     (if (z/branch? z) 
> >       (recur (z/next z)) 
> >       (recur (-> z println z/next)))))) 
> > 
> > 
> > But I'm getting: NullPointerException   clojure.zip/next (zip.clj:236) 
> > 
> > Any ideas? 
> > 
> > Thanks for help. 
> > 
> > -- 
> > You received this message because you are subscribed to the Google 
> > Groups "Clojure" group. 
> > To post to this group, send email to clo...@googlegroups.com 
> <javascript:> 
> > Note that posts from new members are moderated - please be patient with 
> your 
> > first post. 
> > To unsubscribe from this group, send email to 
> > clojure+u...@googlegroups.com <javascript:> 
> > For more options, visit this group at 
> > http://groups.google.com/group/clojure?hl=en 
> > --- 
> > You received this message because you are subscribed to the Google 
> Groups 
> > "Clojure" group. 
> > To unsubscribe from this group and stop receiving emails from it, send 
> an 
> > email to clojure+u...@googlegroups.com <javascript:>. 
> > For more options, visit https://groups.google.com/d/optout. 
>

-- 
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 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to