welcome @nblumoe 🙂
Hi @pesterhazy
Ready to take a noob question? 😄
always!
Excellent 😄
So, I managed to communicate with a socket repl started with clj -J-Dclojure.server.repl="{:port 5555 :accept clojure.core.server/repl}"
. How do I get unrepl on that repl? Do I need to pass it via :accept
? I was going to use the reference implementation from https://github.com/Unrepl/unrepl
the reference implementation has a start-aux
function which seems to be the entry point…
I guess I could call that from the socket repl to get it going. But I am not so sure that I am doing the right thing here….
@nblumoe do you want to use an existing client, or write your own?
own
I'm trying right now
how do I install clj?
I'm asking the newb questions here @nblumoe
Mac? brew install clojure
ah I tried "brew install clj"
clj -J-Dclojure.server.repl="{:port 5555 :accept clojure.core.server/repl}"
Exception in thread "main" java.io.FileNotFoundException: -J-Dclojure.server.repl={:port 5555 :accept clojure.core.server/repl} (No such file or directory)
haha
I already had a script called clojure
😄
lein unrepl-make-blob
rlwrap cat resources/unrepl/blob.clj - | nc localhost 5555
gives you a nice prompt
unrepl is usualy loaded by "upgrading" an existing basic repl (clojure.core.server)
the advantage being no configuration on the serve side, other than opening the port
and when unrepl doesn’t do what you want, you fork , patch it and use the resulting blob
@cgrand maybe these two lines would make a nice addition to the unrepl readme?
so you are free to experiment or have to wait for me to fix a bug
(welcome @nblumoe btw)
Ok I see, thanks. (And actually I also remember now 😄 )
and blob.clj
I am going to build via <https://github.com/Unrepl/unrepl/blob/master/tasks/leiningen/unrepl_make_blob.clj>
right?
right that's the lein unrepl-make-blob
I mentioned
Cool thanks. Working from CLI now
hello all, does the scripts/loop
is working for everyone ? e.g : rerun lumo after it has been killed
and also working from within my code now…. Thanks!
@nblumoe may I ask what you are doing? just toying around or more?
Sure, we would like to use it for Clojure code evaluation on https://nextjournal.com/
cool
Quite nice (except the blue ;)) !
I could even render classes and symbol differently
great!
🎉
iterm2 supports hover???
that’s hyperlink detection, but it supports (and libvte too) true hyperlinks
pretty sweet
and I have seen in the propieraty escapes codes a thing about hints displayed on hover (and also sending a system notification)
I mean we need to tread carefully here because we don't want to venture too far into detecting terminal types etc.
but this looks potentially super useful
I used none of those because of this
ah, java.io.File is (incorrectly) detected as a URL
got it now
is that packed applying the colors?
https://www.iterm2.com/documentation-escape-codes.html for iterm2
https://github.com/Unrepl/unravel/blob/packed-printing/src/unravel/pprint.cljs
it’s the unravel ansi rendering for packed
you just interpret the [:span ...]
data structures in a colored way?
decoupling: packed only cares about the length of the spans (it doesn’t even know how to retroeve their content), so it computes a layout and then an application specific renderer do the actual rendering using extra fields or methods on spans
(defn ansi [text ansi-text]
{:length (count text)
:text ansi-text
:start-length (count text)
:start-text ansi-text
:br-after? true})
creates a span, length, start-length and br-after are for packed; text and start-text are for the renderer
so I (ab)use the text renderer by putting ansi escapes into the rendering
it’s ok as long as the declared length is the displayed length
(forgot to push)
So the telling code sample is this cond
clause:
(keyword? x) (let [s (str x)] [(ansi s (str “\33[36m” s “\33[m”))]) ; cyan
cool
@pesterhazy I havens created a PR for packed but it’s good to go.
@pesterhazy I guess I found the ^J
eater: https://github.com/nodejs/node/blob/master/lib/internal/readline.js#L401-L404