OK, I dug into the Clojure source and found a way to solve my issue. If I wrap the pr-str in (binding [*print-dup* true] (pr-str form)) it works.
On Apr 17, 5:34 pm, nathanmarz <nathan.m...@gmail.com> wrote: > So I've been hacking for the past day on making serializable functions > for Clojure (building off the work of @technomancy in his serializable- > fn repo). > > I'm running into a nasty problem though, and I really don't understand > what's going on. One of the things I'm doing in my code > (https://github.com/nathanmarz/serializable-fn/blob/master/src/clj/ser... > ) is trying to capture the source code whenever someone uses the > replacement serializable.fn/fn macro. I'm using &form to do this. > > However, *sometimes*, the form when serialized contains a bunch of > subforms missing. The subforms are replaced with a "#" character. To > serialize I'm just calling pr-str on the form. > > The way the behavior is reproduced is odd as well. If I run the > Cascalog tests (in this > branch:https://github.com/nathanmarz/serializable-fn/blob/master/src/clj/ser...), > everything works fine until one of the last test suites, > cascalog.predicate-test, where I get this behavior (causing > deserialization errors). However, if I run just that test suite (lein2 > test cascalog.predicate-test) it passes. It only fails if I run the > whole test suite, and it always fails the exact same way. So > whatever's causing this behavior is not random but consistent. > > Does anyone know what could be causing this behavior and how to fix it? -- 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