chlorine-clover

About Chlorine for Atom and Clover for VS Code: https://atom.io/packages/chlorine and https://marketplace.visualstudio.com/items?itemName=mauricioszabo.clover
mauricio.szabo 2020-02-25T01:15:45.053100Z

Oh, well....... it seems the problem is harder than I thought. When Chlorine connects to a socket, it sends the UNREPL string to upgrade the REPL. This binds *out* to unrepl.core/write When any command (like load-file) runs, if it uses *test-out* (because, for some reason, it is different from *out* and so it is not sent over the socket) Chlorine will try to bind it to *out* (so we'll see the results in Atom).

mauricio.szabo 2020-02-25T01:18:17.055100Z

Then things get weird: this *out* does not exist on other REPL connections.... so it raises the error. Even if I try to bind *test-out* locally, load-file will make it leak for the outside world (because it uses def, that changes environments globally, for all threads)

sparkofreason 2020-02-25T16:40:22.059Z

Here's the solution I came up with for using #reveal with #chlorine (hat tip to @seancorfield for getting me unstuck): Add this alias:

:reveal {:extra-deps {vlaaad/reveal {:mvn/version "0.1.0-ea4"}}
           :extra-paths ["/Users/dave.dixon/.clojure"]
           :jvm-opts ["-Dclojure.server.repl={:port,50505,:accept,my.repl/start}"]}
pointing to your .clojure folder (or wherever you want to run startup scripts). In that folder add this clj file in the appropriate hierarchy:
(ns my.repl
  (:require [vlaaad.reveal.ui :as ui]))

(def reveal (ui/make))

(defn start
  []
  (clojure.core.server/repl))
Then modify the wrap_in_rebl_submit from @seancorfield's init.coffee as:
wrap_in_rebl_submit = (code) ->
  "(let [value " + code + "] " +
  "  (try" +
  "    ((requiring-resolve 'cognitect.rebl/submit) '" + code + " value)" +
  "    (catch Throwable _))" +
  "  (try" +
  "    ((requiring-resolve 'my.repl/reveal) value)" +
  "    (catch Throwable _))" +
  "  value)" 

vlaaad 2020-02-25T21:08:17.060100Z

@mauricio.szabo I added normal repl to Reveal (in addition to prepls) and tried it with Chlorine, you might be interested: https://github.com/vlaaad/reveal/issues/2#issuecomment-591068889

vlaaad 2020-02-25T21:10:26.061400Z

I'm not sure if Chlorine and Reveal can easily compose, Chlorine seems to need structured output provided by unrepl, and Reveal is supposed to be used as a repl directly...

sparkofreason 2020-02-26T16:22:45.069700Z

So far I haven't seen any issues...so far.

vlaaad 2020-02-26T16:34:33.069900Z

Iā€™m glad that you gave it a try! By the way, you can try doing this on repl start:

(add-tap (ui/make))
While the JVM remains running, there will be a window with tap> results

vlaaad 2020-02-26T16:35:09.070100Z

Iā€™d be happy if you shared your thoughts about using Reveal

sparkofreason 2020-02-26T18:42:34.070300Z

I'll post them to #reveal as I get some more time with it.

seancorfield 2020-02-25T21:12:10.062100Z

So (ui/make) returns a function that can be invoked on values @vlaaad? That's an interesting model...

vlaaad 2020-02-25T21:12:45.062300Z

yep

vlaaad 2020-02-25T21:13:08.062700Z

ASAP (as simple as possible)

1
mauricio.szabo 2020-02-25T21:38:09.064300Z

Great, I'll look at is ASAP (as soon as possible šŸ˜†) On a side note, just published 0.4.12, which will (hopefully!) fix the @aviflax's bug, and also probably fix the errors on unrepl.core/write being unbound šŸ™‚

1šŸ‘1šŸ¤Æ1šŸ’Ŗ1šŸŽ‰
seancorfield 2020-02-25T21:43:37.065300Z

@mauricio.szabo Is there any way to control how tall (or wide) the console/repl pane is when it opens?

1āž•
seancorfield 2020-02-25T21:44:14.066100Z

By default it opens half height (or half width) and it would be nice (for me, at least šŸ™‚ ) to be able to specify a smaller height (or width).

seancorfield 2020-02-25T21:44:56.066700Z

(what made me think of that is that the linter UI package lets you set a maximum height as a config option)

mauricio.szabo 2020-02-25T22:29:29.068300Z

There's no such option for now, but I also am thinking on adding it. Will check the Atom API and see how to control it

1šŸ‘2