Hi, I'm tinkering with a customised reveal setup where one of the things I'd like to achieve is to display summarized representation of repl-evalueated forms; ideally one-per line and then use view:value to drill into an object if I am intersted in the details. Any ideas how to achieve that?
Yes! There is as streaming fn that was created for this purpose https://github.com/vlaaad/reveal/blob/master/src/vlaaad/reveal.clj#L289-L296
For example, this is how Reveal’s prepl output shows prepl errors that are datafied throwables in the VM, but displayed as error summaries that allow showing the datafied throwable https://github.com/vlaaad/reveal/blob/d472efebaafe0ba94034fbe5d2d0a991aae8248e/src/vlaaad/reveal/prepl.clj#L10-L15
Goood idea, thank you! Data structure (a big tree ususally)
Yes, using that one already... Is there something I can use to "shorten" a big form or I should do this manually? Thanks for the help
Hmm I don't think there is anything ready
Do you have the form as string or asv data structure?
If you have a data structure, you can bind *print-length* and *print-level* to small numbers and pr-str the form to something short