This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-06-14
Channels
- # beginners (31)
- # boot (9)
- # cider (10)
- # cljs-dev (9)
- # cljsrn (16)
- # clojure (222)
- # clojure-austin (4)
- # clojure-france (13)
- # clojure-italy (21)
- # clojure-nl (2)
- # clojure-russia (71)
- # clojure-spec (9)
- # clojure-uk (39)
- # clojurescript (50)
- # cursive (16)
- # datomic (69)
- # dirac (2)
- # figwheel (1)
- # graphql (19)
- # hoplon (4)
- # jobs (1)
- # klipse (3)
- # leiningen (4)
- # liberator (3)
- # luminus (9)
- # lumo (9)
- # off-topic (3)
- # om (21)
- # onyx (11)
- # parinfer (2)
- # pedestal (8)
- # planck (19)
- # re-frame (17)
- # reagent (12)
- # remote-jobs (1)
- # ring-swagger (3)
- # spacemacs (17)
- # specter (23)
- # sql (1)
- # unrepl (64)
- # untangled (19)
- # yada (5)
soooo...maybe it is a bit off topic here, but I am going to put it out
as @anmonteiro knows I am trying to detect the repl type in inf-clojure
. There more general problem is advertise your own type. I need to do the same for a plain clj repl, a plain cljs repl, a @thheller shadow
clj repl, a @thheller shadow
cljs repl, @mfikes planck, ...
so I was wondering if it is a good idea to agree on a common way
a function call was my proposal but it seems it is not the best for repl devs
I am open to any proposal, the only restriction is that I will need to send text and receive text
[zilence@zpro ~/code/shadow-cljs/target]$ rlwrap nc localhost 8201
shadow-cljs - REPL - see (help), :repl/quit to exit
[104:0]~shadow.user=> (shadow/node-repl)
[104:1]~cljs.user=>
as a bit of context maybe … shadow-cljs
now provides a socket-repl that you can “upgrade” to CLJS
either parsing the terminal output or the string returned on the websocket
now actually I see your case is the simplest @thheller because I have a function there so from that moment on I could just switch. If shadow/node-repl
returned the repl type I can just use that
yeah I see that I could do that, but I would like to have a way that does not consider prompts because prompts in inf-clojure
have weird regexes associated with them and comint
kind of excludes them from the output if matching the regex
https://github.com/thheller/shadow-cljs/blob/master/src/main/shadow/cljs/npm/client.cljs#L51-L68
this would be good:
[2:0]~shadow.user=> (shadow/node-repl)
"shadow-cljs"
[2:1]~cljs.user=>
emacs is a weird beast and I am trying to define the minimal amount of changes to do in there
see above, the prompt might be parsed out
still need to double check that, but it feels complicated given my inf-clojure
knowledge 😄
but the prompt would be shadow-cljs anyways .. need something that all tools support
my goal would be for repl devs to agree on a way to return that info
so let's wait for others as well ok?
for a bit of background: https://github.com/anmonteiro/lumo/issues/174
cgrand: oh this is the best idea so far! way easier 🙂
something I can call like (reader/next reader-state chunk-of-text)
and get [next-state forms]
or so
need something that I can do partial read and continue when I have more data to feed it
Can't give details now but here is the reader (search for edn-read
https://github.com/cgrand/cljs-js-repl/blob/master/src/net/cgrand/cljs/js/repl/async_reader.cljs
And socket-reader
here https://github.com/cgrand/cljs-js-repl/blob/master/src/net/cgrand/lumo/socket_repl.cljs
maaaan sometimes it so simple thanks @cgrand!