reveal

Docs: https://vlaaad.github.io/reveal/ Source: https://github.com/vlaaad/reveal
vlaaad 2020-08-03T05:14:06.175800Z

I'm not sure I can do it, Rich told the way its implemented is internal details we shouldn't rely on in code (defn-ed functions have static fields pointing to vars)

seancorfield 2020-08-03T05:34:45.176600Z

Yeah, that doesn't actually surprise me -- although I'm pretty sure I've seen someone share the code on Slack at some point...

Janne Sauvala 2020-08-03T05:52:30.179Z

Is there an example setup for Reveal with Cursive? I have been using REBL like this: https://github.com/cognitect-labs/REBL-distro/wiki/REBL-in-IntelliJ-Cursive

EmmanuelOga 2020-08-04T09:52:12.184200Z

on that note I wish there was some more info on running it with cider... it occurred to me to run it directly on the cider REPL by invoking (vlaaad.reveal/repl) and it broke all sort of havoc inside emacs, so I'm guessing there must be a different way to set it up

EmmanuelOga 2020-08-04T09:52:36.184400Z

probably can run it from command line which is fine but then I won't be able to send things from emacs to the repl

vlaaad 2020-08-04T10:07:47.184600Z

Are you using nrepl? There is a middleware for nrepl

EmmanuelOga 2020-08-04T10:18:43.185Z

maybe... I usually use whatever cider does, which inserts middleware automatically

EmmanuelOga 2020-08-04T10:19:08.185200Z

there's a mechanism to request custom middleware to be inserted that I always forget how to use 🙂

vlaaad 2020-08-04T11:29:09.185400Z

Then you are probably using nrepl 🙂 try finding a way to insert vlaaad.reveal.nrepl/middleware in the middleware list

vlaaad 2020-08-04T11:30:17.185600Z

I think @onetom previously found a way to do it: he suggested creating .nrepl.edn file with contents like these: {:bind "0.0.0.0" :port 5555 :middleware [vlaaad.reveal.nrepl/middleware]} maybe that'll work for you?

onetom 2020-08-04T14:58:07.185800Z

@emmanueloga u should specify an alternative directory for your per-user nrepl.edn file via the NREPL_CONFIG_DIR env var. here is an example .idea/runConfigurations/my-module.xml:

<component name="ProjectRunConfigurationManager">
  <configuration default="false" name="Rule Crib with Reveal over nREPL" type="ClojureREPL" factoryName="Local" activateToolWindowBeforeRun="false" singleton="true">
    <module name="my-module" />
    <setting name="replType" value="NREPL" />
    <setting name="execution" value="DEPS" />
    <setting name="jvmArgs" value="" />
    <setting name="parameters" value="" />
    <environment name="NREPL_CONFIG_DIR" value=".reveal" />
    <setting name="workingDir" value="$PROJECT_DIR$/my-module" />
    <setting name="profiles" value="" />
    <setting name="aliases" value="reveal" />
    <setting name="fixLineNumbers" value="false" />
    <method v="2" />
  </configuration>
</component>

onetom 2020-08-04T14:59:43.186100Z

and then, this is what i have in my .reveal/nrepl.edn:

{:bind "0.0.0.0" :port 5555 :middleware [vlaaad.reveal.nrepl/middleware]}

👍 1
EmmanuelOga 2020-08-05T06:08:58.186900Z

cool thx

vlaaad 2020-08-03T06:36:18.179100Z

Rich shared the snippet used to get references. I then adopted it to create this runtime function call tracer: https://gist.github.com/vlaaad/0350b61e127e82165d195b490999ec0a

1
vlaaad 2020-08-03T06:38:58.179300Z

No example so far, but I'm planning to add it once reveal is going 1.0 In short, you create local repl run configuration with clojure.main, and select your parameters to be -m vlaaad.reveal repl

Janne Sauvala 2020-08-03T06:40:00.179500Z

I’ll try this later today. Thanks!

vlaaad 2020-08-03T06:40:04.179700Z

Or, if you have such main-opts in a clj alias, you can select "run with deps" and select that alias

1