Hello there!
I'm trying to implement a better way to print #unrepl/object
, and my first try was on this PR: https://github.com/Unrepl/unrepl/pull/49. Then I found out that it wouldn't work as good as I imagined, so I began to explore alternatives. One of the ideas I had was to use edn/read-string
over pr-str
. This works to some extent, but elisions don't
So, for example, if I try to eval the code:
(let [lst (java.util.LinkedList.)]
(doseq [n (range 100)] (.add lst n))
lst)
It renders a valid key: :pr-str (0 1 2 3 4 5 6 7 8 9 #unrepl/... {:get (unrepl.repl$RAF27JuLJi7mSBYfklsxbq$Xbf0/fetch :G__42779)})
, but trying to fetch the elision returns just (...)
So, how exactly does elisions work, and how could I implement somekind of "pretty parser" to generic Java objects? To explain better my problem, I am using UNREPL on Atom's Chlorine package, but when I evaluate some code that returns a java object that have a Clojure representation (like some datomic-free queries that return java.util.HashSet
or something that overrides print-method
) I want to be able to render the result the same as it would appear over nREPL, for example...