vlaaad / reveal

Read Eval Visualize Loop for Clojure

Home Page:https://vlaaad.github.io/reveal/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

:paragraph blocks

semperos opened this issue · comments

Thank you for this awesome open source contribution ❤️

I believe there's a missing case clause in vlaaad.reveal.stream here for the :paragraph value. Here's the stacktrace I encountered:

Exception in thread "reveal-stream-thread" java.lang.IllegalArgumentException: No matching clause: :paragraph
	at vlaaad.reveal.stream$format_xf$fn__151917.invoke(stream.clj:299)
	at vlaaad.reveal.stream$op$fn__151833.invoke(stream.clj:30)
	at vlaaad.reveal.stream$_EQ__GT_$fn__151830.invoke(stream.clj:24)
	at vlaaad.reveal.stream$_EQ__GT_$fn__151830.invoke(stream.clj:24)
	at clojure.lang.AFn.applyToHelper(AFn.java:156)
	at clojure.lang.AFn.applyTo(AFn.java:144)
	at clojure.lang.AFunction$1.doInvoke(AFunction.java:31)
	at clojure.lang.RestFn.invoke(RestFn.java:421)
	at vlaaad.reveal.stream$emit_xf$fn__151905.invoke(stream.clj:237)
	at vlaaad.reveal.ui$oneduce.invokeStatic(ui.clj:176)
	at vlaaad.reveal.ui$oneduce.invoke(ui.clj:171)
	at vlaaad.reveal.ui$make$fn__153639$fn__153640.invoke(ui.clj:276)
	at vlaaad.reveal.ui$make$fn__153639.invoke(ui.clj:273)
	at clojure.lang.AFn.run(AFn.java:22)
	at java.lang.Thread.run(Thread.java:745)

Versions:

  • vlaaad/reveal 0.1.0-ea13
  • Clojure 1.10.1
  • Java 8

Hi, glad you like it!
Hmm, IIRC that is intentional: :paragraph is supposed to be a leaf block and it should not have any other children blocks (the case in question looks at a parent of a pushed block). Do you have an example value that leads to this exception when submitted to the reveal output panel?

At the time, I was trying to test the limits of reveal and I had made it print the entirety of a system map for a non-trivial application. The output was enormous and varied in its content. I'll see if I can replicate this exact error by narrowing down to smaller pieces of that map, but given the size of the map I may not be able to find it in a timely fashion.

If this is by design in terms of which blocks are meant to be leaves, then hopefully this will be a rarely-encountered issue. I'll let you know if I manage to narrow down the data that triggered this.

Thanks for a speedy reply!

You could try "bisecting" it: select half of the keys from the root map, if it fails, split that part in half again, else split the other part, etc. — the offending value might be found pretty quickly I hope :)