Hi,

I am trying to write a function that recursively traverses a given
object - applying a function to each node. Something along these
lines:

(defn traverse [f os]
  (f os)
  (when (coll? os)
    (doseq [o os]
      (traverse f o))))

Although this fragment seems to be doing the job, I am not sure that
the underlying assumption - which is: everything that is not a
collection cannot be further decomposed - is true. Perhaps there's a
language construct that produces an object which is not a collection
but can be decomposed using some other mechanism?
(Seems highly unlikely, but I want to make sure that I am not missing
anything)

Thanks,
-Itay







I am

--~--~---------~--~----~------------~-------~--~----~
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