This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-02-22
Channels
- # aws-lambda (2)
- # beginners (195)
- # boot (47)
- # capetown (14)
- # cljs-dev (7)
- # cljsjs (1)
- # cljsrn (1)
- # clojure (103)
- # clojure-berlin (28)
- # clojure-dev (92)
- # clojure-dusseldorf (3)
- # clojure-finland (2)
- # clojure-germany (3)
- # clojure-italy (4)
- # clojure-russia (37)
- # clojure-spec (104)
- # clojure-uk (52)
- # clojured (2)
- # clojurescript (124)
- # community-development (7)
- # core-async (6)
- # cursive (41)
- # datomic (53)
- # dirac (2)
- # emacs (16)
- # hoplon (5)
- # jobs (3)
- # juxt (12)
- # lein-figwheel (6)
- # leiningen (15)
- # luminus (3)
- # off-topic (49)
- # om (5)
- # onyx (13)
- # overtone (27)
- # re-frame (7)
- # reagent (46)
- # ring (3)
- # ring-swagger (11)
- # spacemacs (2)
- # specter (40)
- # sql (6)
- # untangled (149)
- # vim (14)
@bronsa I'm trying to use tools.reader
on *in*
which is a clojure.lang.LineNumberingPushbackReader
but that does not seem to work
clojure.lang.ExceptionInfo: clojure.lang.LineNumberingPushbackReader cannot be cast to java.io.InputStream {:type :reader-exception}
at clojure.core$ex_info.invokeStatic(core.clj:4725)
at clojure.core$ex_info.invoke(core.clj:4725)
at clojure.tools.reader$read_STAR_.invokeStatic(reader.clj:934)
at clojure.tools.reader$read_STAR_.invoke(reader.clj:897)
at clojure.tools.reader$read.invokeStatic(reader.clj:965)
at clojure.tools.reader$read.invoke(reader.clj:942)
#object[java.net.URL 0x642ac8fe "jar:file:/Users/zilence/.m2/repository/org/clojure/tools.reader/1.0.0-beta3/tools.reader-1.0.0-beta3.jar!/clojure/tools/reader.clj"]
if it doesn't, can you try and give me a minimal repro? as you can See above I just tried it and it worked fine for me
if that fails, you might have multiple versions of tools.reader in your classpath or something like that
right, so just to make sure if you eval (reader/read *in*)
and type 1
you get that exception?
form
(binding [*ns*
(create-ns ns)
ana/*cljs-ns*
ns
ana/*cljs-file*
name
reader/*data-readers*
tags/*cljs-data-readers*
reader/*alias-map*
(merge reader/*alias-map*
(:requires ns-info)
(:require-macros ns-info))]
(prn [:reading-from *in* opts])
(try
(reader/read opts in)
(catch Exception e
(prn [:wtf (.getMessage e)])
(throw e))))
[:reading-from #object[clojure.lang.LineNumberingPushbackReader 0x726ff63d "[email protected]"] {:eof #object[java.lang.Object 0x208ac70d "java[email protected]"], :read-cond :allow, :features #{:cljs}}]
[:wtf "clojure.lang.LineNumberingPushbackReader cannot be cast to java.io.InputStream"]
@alexmiller how "official" is the socket REPL sessions stuff? I have some thoughts on the subject but nothing except clojure.core.server/*session*
seems to exist?
That all got yanked out before the final
So it's not a thing
No, no plans to do anything more with that right now
But you can write your own socket server that does whatever you need
They can be programmatically installed too, so you can set up whatever you need before you start the server
Should work - what's the issue?
the issue is if you have a tool reading *out*
trying to do things like syntax highlighting (ie. Cursive)
Yeah, not sure what the repl could do about that
the (cljs)
loop can rebind *out*
but at some point some output must go the real *out*
I have a repo with some sketches of how tools could work with the socket repl at https://github.com/puredanger/replicant
my idea was that every new loop, informs the current loop that it is no longer in charge
Generally it's easiest to design the repl you want rather than to nest
The main repl is very customizable
anyways, I will try some things. just wanted to check if there was some official progress on that front.
If you want a stream compliant client, then in/out/err is all you have. :)
just a rough idea so far, might totally not work out. basically I'm just looking for a way to "extend" the standard stream model. If I'm in an IDE I want pretty output, when I just telnet somewhere it is ok to just have text
(loop []
(prompt)
(let [form
(read)
[js warnings]
(cljs-compile form)]
(if-let [cb (get *session* :cljs/compiler-warnings)]
(cb warnings)
(print-warnings warnings))
(let [result (eval js)]
(print result)
(recur))))