nrepl

https://github.com/nrepl/nrepl || https://nrepl.org
flowthing 2018-10-30T12:00:21.014400Z

So I wanted to give Drawbridge a go. I added the Drawbridge Ring handler into my web app and tried to connect to it like this:

(require '[nrepl.core :as nrepl]
           '[drawbridge.client :as client])

(with-open [conn (nrepl/url-connect "<http://localhost:8000/repl>")]
    (-&gt; (nrepl/client conn 1000)
        (nrepl/message {:op "eval" :code "(+ 2 3)"})
        nrepl/response-values))
But I get this error: ArityException Wrong number of args (0) passed to: client/ring-client-transport/read--2318 clojure.lang.AFn.throwArity (AFn.java:429)

flowthing 2018-10-30T12:01:26.015300Z

It looks like the read function in the Drawbridge client expects a single argument (https://github.com/nrepl/drawbridge/blob/941403588c1cde61f8041f4de82ed53bea837590/src/drawbridge/client.clj#L50) but the calling code in nrepl.transport doesn't supply any https://github.com/nrepl/nrepl/blob/ff70f1e4cac4ee72cdaba1d95f1216640c84e572/src/clojure/nrepl/transport.clj#L41).

flowthing 2018-10-30T12:02:26.016Z

I can't see how that'd work, but maybe I'm missing something. I didn't dive too deeply into the code yet.

bozhidar 2018-10-30T13:40:27.016600Z

@flowthing File a ticket for this. I think someone mention this breakage as well, but I didn’t find a time to investigate it and I forgot about it.

bozhidar 2018-10-30T13:41:02.017400Z

The fix should be pretty simple, although I’m puzzled how we broke this in the first place, as I haven’t really touched the code apart from updating the namespaces for nREPL 0.4 compatibility.

flowthing 2018-10-30T13:41:23.017600Z

OK, will do.

bozhidar 2018-10-30T13:41:30.017900Z

Thanks!

flowthing 2018-10-30T13:42:08.018600Z

I'm also a bit puzzled, because I blamed both files as far back as they go and as far as I could see, that discrepancy has always existed.

flowthing 2018-10-30T13:42:39.019200Z

Might be I just missed something, though.

flowthing 2018-10-30T13:49:28.019500Z

Filed https://github.com/nrepl/drawbridge/issues/28.

bozhidar 2018-10-30T15:39:12.020100Z

:thumbsup: