Fork me on GitHub
#unrepl
<
2019-05-24
>
Andrea09:05:19

Hello again, à propos datafiables. There’s a behaviour in printing 'unrepl/browsable literals in combination with nav that I cannot understand. Take a dumb example

(defrecord DN [a b]
  clojure.core.protocols/Datafiable 
  (datafy [this] (into {} this)) 
  clojure.core.protocols/Navigable 
  (nav [this k v] (clojure.datafy/datafy v)))
then feeding unrepl a (DN. 1 2) and following the first elision for the browsable result in this malformed EDN which makes trouble with the reader:
[:eval (({:a # [nil #unrepl/... {:get (unrepl.repl$4NSDREePlCk74VjoImLYAZy60JQ/fetch :G__785)}], :b # [nil #unrepl/... {:get (unrepl.repl$4NSDREePlCk74VjoImLYAZy60JQ/fetch :G__786)}]})) 6]
Am I using nav the wrong way?

Andrea09:05:34

the example above doesn’t comply with rebinding of the variable x at https://github.com/Unrepl/unrepl/blob/111b729e2cb49c81149f5eb9fb4a27f70b875a3d/src/unrepl/printer.clj#L363-L367 in the machine printable protocol for browsable tagged literals

Andrea09:05:17

It seems that (:tag x) and (:form x) are nil in the above example