On Apr 16, 10:45 am, Stuart Sierra <[email protected]>
wrote:
> As an alternative, you could quote the entire expression (you can quote
> anything, not just lists) when copying data structures into a test.
>
> -S
It never occurred to me to do that.... so I guess that works...
As my alternative, I went off and wrote this as I find it easier to
mentally parse datastructures that uses vectors rather than quotes.
(defn lists->vectors
"Replaces lists and lazy sequences with vectors"
[obj]
(let [f #(if (or (list? %) (instance? clojure.lang.LazySeq %))
(apply vector %) %)]
(postwalk f obj)))
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to [email protected]
Note that posts from new members are moderated - please be patient with your
first post.
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