This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-11-24
Channels
- # aws (14)
- # beginners (111)
- # boot (12)
- # cider (1)
- # cljsrn (7)
- # clojure (65)
- # clojure-dusseldorf (1)
- # clojure-germany (7)
- # clojure-greece (10)
- # clojure-italy (13)
- # clojure-poland (7)
- # clojure-russia (7)
- # clojure-spec (53)
- # clojure-uk (29)
- # clojurescript (27)
- # community-development (9)
- # cursive (2)
- # data-science (1)
- # datomic (17)
- # emacs (16)
- # events (6)
- # fulcro (155)
- # graphql (8)
- # instaparse (1)
- # leiningen (30)
- # lumo (29)
- # om-next (3)
- # other-languages (46)
- # pedestal (11)
- # portkey (7)
- # re-frame (13)
- # reagent (6)
- # ring (8)
- # rum (1)
- # shadow-cljs (75)
- # sql (1)
- # timbre (3)
- # unrepl (128)
@cgrand did you notice the elision for letters
seems a bit weird? shows the first 10, then the rest
doesn't stop at 20... not sure why, maybe because I'm modifying the print limits in the documentation
but i examine unrepl.print/print-length and it's 80.. maybe is the same bug we were discussing on github
I restart them after getting the doc to whatever bak#
was, I haven't checked if it's done correctly though... I'll take a look later...
> but why does it elide after the first 10? Do you mean why it doesn’t elide after the first 10
actually I meant: why does it elide the first 10? If the print-limits were in fact left in MAX_VALUE, shouldn't it return the whole 26 letters at once?
If we want print-length at, say, 25.. the first result will always be elided at 10, right?
if you guys have some time for some basic stuff I would very grateful
I got how socket-connector
work and why you use make-strip
I am struggling to understant the safe-read-string
part 😞
yes, but it's kinda the same problem as resolving elisions on user
, setting print-limits in user
would also mess *1 *2 *3...
@baptiste-from-paris can you point to a line in the code?
unravel.network
ns line 47 => (when-let [[v rst] (ul/safe-read-string (.toString buf))]
read-string
throws an exception if it cannot read the string, perhaps because it has unbalanced parens
hm or maybe it doesn't, wait...
maybe that used to be the case (hence the name) but currently "safe" is not a good name for the function 🙂
it basically reads the next form, returns that PLUS the rest of the string
it's used because it's a stream of EDN values
it might be newbish to ask that but what this binding is actually doing ?
(binding [reader/*default-data-reader-fn* tagged-literal
reader/*data-readers* ut/tag-map]
(let [r (reader-types/string-push-back-reader s)]
[(reader/read r)
(uu/unblank (clojure.string/trim (read-chars r)))]))
binding *
this is a sort of implicit parameter for the reader
it makes sure that tagged literals are returned as defrecords
binding sets up a dynamic variable context (think of it as setting the variable, then restoring it at the end of the block)
thanks ! it makes sure that tagged literals are returned as defrecords => that’s what I was looking for
there's also special handling for elisions and vars (these are printed in a special way)
sure thing! feel free to ask question about the code btw
thanks !
@volrath emitting commands on user
is baaaaad (first rule of unrepl), unrepl/do
is thus an abomination,
the problem is that we are trying to modify dynamic bindings of one connection from another one
right.. don't they all share a common state? tbh I have very little insight of the deep ends of unrepl, but I've noticed that If I open two user connections to the same socket repl, they share state
now, I'm guessing that's mostly because in this scenario, both conns are on user
.. but couldn't we just create a aux/tooling namespace that unrepl knows to check for common variables
@pesterhazy in Chez how do you transition to viewing the whole form when you see only the first?
it's really quite natural - that's readline's default binding for "redraw the current line"
also, using the down key you can cycle through the lines (not sure how useful that feature is)
Alt-up and Alt-down navigates history on a strict first-line-only basis
are you on macos? it's pretty easy to install brew install --HEAD michaelballantyne/homebrew-chez/chez-scheme
(I think you need quartz too for some reason)
not all users are readline nerds, but many command line powerusers are - and we're trying to reach those
Question: right now unravel starts in the unrepl.replG__20
ns - should we make sure the repl starts in user
?
Or is it better to isolate each session?
unrepl.replG__20
is wrong and fixed in recent blobs (eg in multiline it starts on user)
so @pesterhazy, to be clear, the safe-read-string
transforms input text from unrepl
into it’s cljs
form which where you can process
it by following the unrepl
protocol right ?
@baptiste-from-paris yeah it reads a form
an unrepl
spec one ?
@baptiste-from-paris like this (read-string "[:foo] [:bar]")
unrepl.replG__20=> (read-string "[:foo] [:bar]")
[:foo]
this is clojure's read-string, the function is unravel is similar except that it returns the remaining string as well
what do you mean by spec?
yes I know what read-string is supposed to do, but the kind of message that it reads follow the unrepl protocol
yeah exactly
that’s what I was trying to ask ^^
you can check by passing --debug
- it will print all messages
at the cost of making it unusable because of all the noise 🙂
Yes I’ve seen it !
@cgrand you mean like passing a --init-ns my.core
option?
it would be cool to have a --debug-out
argument, so you can tail that file in another terminal
you can see debug messages and still actually use the prompt
you mean a read-only terminal ?
you could pipe out to a file then
(defn err-prn
"Print directly to stderr, circumventing *out*"
[& args]
;; TODO: flush?
(.write js/process.stderr (apply prn-str args)))
yeah stderr would work too, true
@pesterhazy when I was working on the side loader and copying from unravel's sideloader branch, I used to do: ./scripts/run localhost 5555 2> debug.log
then tail that.. it works. definitely easier with an argument though
oh your point is that it already writes to stderr, forgot about that!
sweet
the best feature is the one that doesn't have to be implemented
@cgrand can't reproduce the autodoc issue right now?!
let's consider it 0-line fixed then
@pesterhazy ^^ not like Chez
one more question about the PR ^^
@cgrand, do you commit a new blob to the repo when you update unrepl's master? Or are consumers expected to run lein unrepl-make-blob
themselves?
@cgrand, latest blob seems to break the tests: https://github.com/Unrepl/unravel/pull/40
Error: stream.push() after EOF
it also returns #unrepl/ns user
- should I just unwrap that on the client side?
latest blob has a new #unrepl/quote tag that, tbh, i don't know what is it for haha, so I'm on master~1
Quoting intend to make it possible to not have display glitches when working on unrepl source code – granted it’s a niche
@cgrand, what's the advantage over clojure.pprint?
=> (binding [clojure.pprint/*print-right-margin* 30]
(clojure.pprint/pprint {:a :b :c {:e :f :g :h :i :j :k :l} :m :n :o {:p {:q :r :s :t}}}))
{:a :b,
:c
{:e :f,
:g :h,
:i :j,
:k :l},
:m :n,
:o {:p {:q :r, :s :t}}}
nil
=> (pprint {:a :b :c {:e :f :g :h :i :j :k :l} :m :n :o {:p {:q :r :s :t}}} :width 30)
{:a :b, :c {:e :f, :g :h,
:i :j, :k :l},
:m :n, :o {:p {:q :r, :s :t}}}
=> (czprint {:a :b :c {:e :f :g :h :i :j :k :l} :m :n :o {:p {:q :r :s :t}}} 30 {:map {:nl-separator? true}})
{:a :b,
:c {:e :f,
:g :h,
:i :j,
:k :l},
:m :n,
:o {:p {:q :r, :s :t}}}
pretty cool!
It would be great to have pluggable printers in unravel
You could even switch the printer "live"
"That's not readable - let me switch to packed layout"
I've wished for that many times