Additionally, if you need more complex access patterns you could see if 
this helps:

https://github.com/akhudek/zip-visit

For performance, there is a fast-zip library that is api compatible with 
clojure.zip. You can just swap the clojure.zip namespace for the fast-zip 
namespace. Note that you'd need to make the same swap in any libraries you 
use with your zippers (like zip-visit) since fast-zip is not implementation 
compatible with clojure.zip.

More broadly, I've found that straight up recursive algorithms can be a lot 
faster than zippers, especially for read only operations. Of course the 
stack size limits what you can do with tree recursion. As others have said, 
it's best to see if you actually have performance problems first. 

On Wednesday, December 4, 2013 5:30:02 PM UTC-5, James Reeves wrote:
>
> On 4 December 2013 21:09, dabd <dario....@gmail.com <javascript:>> wrote:
>
>> I didn't get there because I ran into problems with the zipper API.  When 
>> you call 'children' on a loc you get a seq of nodes instead of a seq of 
>> locs which causes me problems in a recursive algorithm operating on locs.
>>
>
> Have you tried using next and end? for a depth-first transversal?
>
> - James
>

-- 
-- 
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/groups/opt_out.

Reply via email to