Tassilo Horn <tass...@member.fsf.org> writes: Hi again,
I've just debugged it a bit further and now I'm even more confused... > So my reloading function only needs to bind *serialization-bindings* > to a map from graph id to graph, and it should work. > > (defn tg-read [str & gs] > (binding [*serialization-bindings* (into {} (map (fn [g] [(id g) g]) > gs)) > *print-dup* true] (binding [*print-dup* false] (swank.core/break)) ;; DEBUG > (read-string str))) So now I've replaced the println in tg-read with a (swank.core/break) to be able to inspect the environment. And that's what I get: --8<---------------cut here---------------start------------->8--- core> (tg-pr (vertex (rg) 1)) "#=(de.uni-koblenz.funtg.core/vertex (de.uni-koblenz.funtg.core/*serialization-bindings* \"c06de1c7-f4ec0906-21cfbc86-28c31aa1\") 1)" core> (tg-read (tg-pr (vertex (rg) 1)) (rg)) ; Now in the break's environment break> (swank.core/local-bindings) {str "#=(de.uni-koblenz.funtg.core/vertex (de.uni-koblenz.funtg.core/*serialization-bindings* \"c06de1c7-f4ec0906-21cfbc86-28c31aa1\") 1)", gs (#<RouteMapImpl de.uni_koblenz.jgralabtest.schemas.greqltestschema.impl.std.RouteMapImpl@5fbb71ac>)} break> (*serialization-bindings* "c06de1c7-f4ec0906-21cfbc86-28c31aa1") #<RouteMapImpl de.uni_koblenz.jgralabtest.schemas.greqltestschema.impl.std.RouteMapImpl@5fbb71ac> break> (vertex (*serialization-bindings* "c06de1c7-f4ec0906-21cfbc86-28c31aa1") 1) #<VillageImpl v1: localities.Village> break> (de.uni-koblenz.funtg.core/vertex (de.uni-koblenz.funtg.core/*serialization-bindings* "c06de1c7-f4ec0906-21cfbc86-28c31aa1") 1) #<VillageImpl v1: localities.Village> ; Continue from breakpoint IllegalArgumentException: No implementation of method: :vertex of protocol: #'de.uni-koblenz.funtg.core/IDOps found for class: clojure.lang.PersistentList --8<---------------cut here---------------end--------------->8--- But the last expression is exactly what the reader should evaluate and it works fine in the breakpoint. Why doesn't it work inside read-string? Bye, Tassilo -- 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