This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-04-06
Channels
- # architecture (2)
- # aws (6)
- # bangalore-clj (3)
- # beginners (7)
- # boot (29)
- # cider (26)
- # cljs-dev (52)
- # cljsrn (1)
- # clojure (249)
- # clojure-dev (9)
- # clojure-italy (2)
- # clojure-norway (3)
- # clojure-russia (178)
- # clojure-uk (30)
- # clojureremote (6)
- # clojurescript (91)
- # core-async (4)
- # cursive (8)
- # datascript (3)
- # datavis (1)
- # datomic (6)
- # emacs (3)
- # figwheel (2)
- # hoplon (14)
- # incanter (6)
- # luminus (8)
- # mount (7)
- # off-topic (22)
- # om (25)
- # onyx (41)
- # pedestal (7)
- # re-frame (9)
- # ring (1)
- # spacemacs (4)
- # sql (1)
- # uncomplicate (1)
- # unrepl (37)
- # untangled (90)
- # yada (77)
@pesterhazy how do you handle multiple …
?
map elisions returns seq of pairs, that put the burden of maintaining context on the client... I should change that
True haven't looked at kv pairs yet
Something bothers me about hash maps/sets. It’s kind of a detail but it’s very easy to mess their ordering. If the client parses map into its own maps then the print order depends on hash order of the client and not of the order (and if the map was elided it’s a bit of both).
So: is asking client repls author to use a custom edn reader ok or... should maps and sets be rendered as #unrepl/map entries
?
example problem: the user evals (into (sorted-set) (range 100))
, it renders to #{0 ... 99}
but the client reads that and prints #{0 32 64 96 1 33 65 ... 95}
yeah that is why I print the type
of the collection as well, sometimes it is useful to know which collection was used
yeah I ran into the fact that printing works differently in cljs than clj
currently I extend IPrintWithWriter, which works
are there alternative printers? maybe I should look into fipp?
seems like this could be implemented well in a library
I wouldn't necessarily want to write my own printer but not sure how else to do it for map ellisions
>>> To achieve success in philosophy would be, to use a contemporary turn of phrase, to 'know one's way around' with respect to all these things, not in that unreflective way in which the centipede of the story knew its way around before it faced the question, 'how do I walk?', but in that reflective way which means that no intellectual holds are barred.
@cgrand, when I close the input stream, unrepl doesn't seem to send a [:fin]
message
that would be very useful I think
because after unrepl/start
terminates, I get a regular clojure prompt again, user=>
@pesterhazy can you describe steps to reproduce? I'm confused by your last sentence.
if I run this:
cat src/unrepl/{print.clj,repl.clj} <(echo '(unrepl.repl/start)') - | nc localhost 50505
the last lines of output are
[:unrepl/hello {:session :session330, :actions {:exit (unrepl.repl/exit! :session330), :log-eval (clojure.core/some-> :session330 unrepl.repl/session :log-eval), :log-all (clojure.core/some-> :session330 unrepl.repl/session :log-all), :set-source (unrepl.repl/set-file-line-col :session330 <#C4C63FWP5|unrepl>/param :unrepl/sourcename <#C4C63FWP5|unrepl>/param :unrepl/line <#C4C63FWP5|unrepl>/param :unrepl/column)}}]
[:prompt {:file "unrepl-session", :line 1, clojure.core/*warn-on-reflection* false, clojure.core/*ns* <#C4C63FWP5|unrepl>/ns unrepl.repl}]
nil
unrepl.repl=>
(I just typed ^D in nc)
after unrepl/start
finishes, the original repl takes over
then my code tries to interpret that as EDN, which it obviously can't
if I append (write [:fin])
to the end of unrepl.repl/start, I get a signal so I know when the EDN stream ends
i.e. the EDN stream starts with [:unrepl/hello]
and ends with [:fin]
Ok got it: the original repl takes over and prints user=> as its final word before exiting too. Correct?
correct