On Friday 05 December 2008 14:54, Randall R Schulz wrote: > Hi, > > I looked at the Clojure implementation of Huet's Zipper and it looks > great. I like how it delegates construction and dissection of the > tree structure to client-supplied functions so that it is generic > w.r.t. to any types (especially for me, pre-existing, non-Clojure > Java types) that can be deemed to encode a tree structure. > > ...
Now that I've worked around the fact that it's not possible to (use 'clojure.zip) and started playing with this implementation, I finally understand what (-> ...) is for. My next minor stumbling point is another (to me) inexplicable error. Here's what I did: - Made a copy of clojure/zip.clj - Changed the (ns ...) form to (ns rrs.zipper) - Renamed the conflicting (defn replace ...) and (defn remove ...) - Moved the (comment ...) -ed samples to a separate file. I can now evaluate all the forms in the sample code by pasting them into the REPL. However, if I (load-file ...) the source in which those same forms are found, I get this: user=> (use 'rrs.zipper) nil user=> (load-file "/dar/clojure/zipper-test.clj") java.lang.ClassCastException: clojure.lang.LazyCons cannot be cast to clojure.lang.IFn (zipper-test.clj:35) What might explain this? Randall Schulz --~--~---------~--~----~------------~-------~--~----~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/clojure?hl=en -~----------~----~----~----~------~----~------~--~---