Hi Christophe,

On Mar 19, 11:22 am, Christophe Grand <christo...@cgrand.net> wrote:
> Jason Sankey a écrit :
>
> > (if (and (branch? loc) (not (empty? (children loc))))
> >   (recur (-> loc down rightmost))
> >   loc))
>
> > Being new to both clojure and zip I admit there's still a good chance
> > that I have no idea what I'm talking about :).
>
> No you are right and there's the same bug in prev.
>
> Here is a patch that fixes both bugs. (Rich, can I open an issue?)

Thanks for the reply, and a patch which is (not surprisingly) far more
elegant than my hack.  Maybe this little bit of logic should be
extract to its own function (alarms go off when an identical bug shows
up in two places)?

Also, is there somewhere I can contribute test cases for this to
prevent a future regression?

> Btw, (not (empty? coll)) is not idiomatic, (seq coll) is the clojure way to 
> test for non-emptiness.

Thanks, I appreciate the tip.

> Thanks for the report,

No problem,
Jason
--~--~---------~--~----~------------~-------~--~----~
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
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to