This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-05-07
Channels
- # announcements (7)
- # beginners (123)
- # calva (27)
- # cider (23)
- # clj-kondo (4)
- # cljsrn (7)
- # clojure (29)
- # clojure-dev (7)
- # clojure-europe (4)
- # clojure-italy (4)
- # clojure-nl (16)
- # clojure-uk (47)
- # clojurescript (1)
- # code-reviews (4)
- # cursive (4)
- # data-science (4)
- # datomic (30)
- # duct (4)
- # fulcro (4)
- # graphql (1)
- # kaocha (4)
- # mount (8)
- # off-topic (13)
- # overtone (1)
- # pedestal (2)
- # planck (3)
- # re-frame (9)
- # reagent (50)
- # ring (12)
- # shadow-cljs (38)
- # spacemacs (5)
- # testing (13)
- # tools-deps (55)
- # vim (30)
- # xtdb (13)
In the process of trying to get a weirdly configured old project updated and running, I've managed to bork CIDER completely, and am no longer able to either cider-jack-in
or cider-connect
.
- Emacs 26.2
- Getting the problem for both lein and boot projects
- Nothing CIDER or nrepl-refactor related in lein profile.clj
- cider 20190419.1025
- clj-refactor 20190425.1002
- clojure-mode 20190413.909
- But am getting the problem both with CIDER 0.21.0 and CIDER 0.22.0-SNAPSHOT
[nREPL] Starting server via /home/pls/bin/lein update-in :dependencies conj \[nrepl\ \"0.6.0\"\] -- update-in :plugins conj \[refactor-nrepl\ \"2.4.0\"\] -- update-in :plugins conj \[cider/cider-nrepl\ \"0.22.0-SNAPSHOT\"\] -- repl :headless :host localhost...
[nREPL] server started on 42613
[nREPL] Establishing direct connection to localhost:42613 ...
[nREPL] Direct connection to localhost:42613 established
map-apply: Wrong type argument: sequencep, #s(hash-table size 2 test equal rehash-size 1.5 rehash-threshold 0.8125 data ("right-margin" 70 "length" 50))
Here's a backtrace with .lein/profiles.clj disabled on a fresh lein project:
Any assistance would be appreciated, as I've got a interactive presentation later today.
I spent a couple of hours last night slogging through the elisp trying to figure out what's going on...`map-pairs` definitely doesn't like hash table. I tried turning it into a list with a manually written function, but that just pushed the problems further down the line.
Basically, what I tried was replacing map-pairs
with
(defun hash-to-list (hash)
(let (result)
(maphash
(lambda (k v)
(push (list k v) result))
hash)
result))
This gives what looks like a sane output to cider--repl-request-map
, but resulted in another failure in the function calling it.Since this problem doesn't seem to have been reported at the issue, and it might be peculiar to my emacs config, I was hoping somebody here might have some guesses.
Hide cider-print-options: nil
State : STANDARD. (mismatch)
That mismatch is weird.
cider-print-options is a variable defined in ‘cider-client.el’.
Its value is nil
Documentation:
A map of options that will be passed to ‘cider-print-fn’.
Here’s an example for ‘pprint’:
’(("length" 50) ("right-margin" 70))
You can customize this variable.
This variable was introduced, or its default value was changed, in
version 0.21.0 of the cider package.
And jumping to the definition confirms it should be a list. So why would customize report a mismatch?
Looking at the definition of cider--nrepl-print-request-map
, there's this bit:
(let* ((width-option (cider--print-option "right-margin" cider-print-fn))
(print-options (thread-last
(map-merge 'hash-table
`((,width-option ,right-margin))
cider-print-options)
(map-pairs)
(seq-mapcat #'identity)
(apply #'nrepl-dict))))
[...]
Cutting it down to
(thread-last
(map-merge 'hash-table
`(("width" 50) ("right-margin" 70))
nil)
(map-pairs)
(seq-mapcat #'identity)
(apply #'nrepl-dict))
the wrong-type-argument error pops upIt's like the right definition isn't available for map-pairs
on the hash table, and I'm not certain how this could work at all, since I'm guessing cons
doesn't work on hash tables?
(cl-defgeneric map-pairs (map)
"Return the elements of MAP as key/value association lists.
The default implementation delegates to `map-apply'."
(map-apply #'cons map))
Debugger entered--Lisp error: (wrong-type-argument sequencep #<hash-table equal 0/1 0x2b8fbf5>)
mapcar((lambda (l) (apply func l)) #<hash-table equal 0/1 0x2b8fbf5>)
map-apply(cons #<hash-table equal 0/1 0x2b8fbf5>)
map-pairs(#<hash-table equal 0/1 0x2b8fbf5>)
(seq-mapcat (function identity) (map-pairs (map-merge (quote hash-table) cider-print-options)))
So it apparently delegates to map-apply
in map.el
, which should theoretically be able to figure out that a hash table is being passed in.
I'm kind of stumped as to why and how this went awry.
packages cl-lib 1.0, map 2.0, seq 2.20 are installed
Hi all, I updated to latest cider and looks like C-c C-p
now prints only stdout stuff to the new *cider-result*
buffer, whereas it used to print everything... Before I make my own hack, is anyone aware of any other cider func which prints everything to *cider-result*
? didn't see one. Thx!