This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-07-26
Channels
- # aws-lambda (15)
- # babashka (7)
- # beginners (124)
- # calva (7)
- # cider (19)
- # clj-kondo (26)
- # clojure (261)
- # clojure-australia (3)
- # clojure-dev (10)
- # clojure-europe (45)
- # clojure-nl (4)
- # clojure-uk (6)
- # clojurescript (10)
- # datomic (7)
- # depstar (7)
- # emacs (11)
- # fulcro (41)
- # graalvm (48)
- # helix (1)
- # honeysql (17)
- # inf-clojure (7)
- # introduce-yourself (3)
- # jackdaw (2)
- # lsp (36)
- # malli (2)
- # meander (2)
- # membrane (1)
- # missionary (11)
- # off-topic (17)
- # pathom (83)
- # polylith (15)
- # re-frame (31)
- # reagent (42)
- # sci (35)
- # shadow-cljs (13)
- # spacemacs (13)
- # sql (19)
- # timbre (3)
- # tools-deps (77)
hey guys, I think someone identified a bug based on an error I was getting, where cider-nrepl overrides print-method because there's a variation on what this command displays, seen in this picture by @vemv. The issue is that it creates an invalid symbol with three slashes which blows up edn serialization of metadata. The original thread was here: https://app.slack.com/client/T03RZGPFR/C0617A8PQ/thread/C03S1KBA2-1627233840.296600
Good summary of the issue. I think you meant two slashes though It seems good to me to create an issue in the adequate repo, sounds like it has a reasonably easy fix
I have a macro which expands fine in the cider repl, and expands fine at the lein repl, But refuses to expand using cnt-c-RET.
I get a message in the *Messages*
buffer: nrepl-send-sync-request: Sync nREPL request timed out (op macroexpand expander macroexpand-1 code
any ideas what that is trying to tell me?
other macros expand without problem.
Here is an example of the macro expansion, which may be a lot of code, but macroexpand finishes in half a second
(let* [or__5501__auto__ (and (member q sink-states) (not draw-sink))] (if or__5501__auto__ or__5501__auto__ (clojure.core/or (clojure-rte.cl-compat/cl-cond (:else (when (:accepting q) (cl-format *out* " q~D [shape=doublecircle] ;~%" (:index q)) (cl-format *out* " X~D [label=\"~A\", shape=rarrow]~%" (:index q) ((:exit-map dfa) (:index q))) (cl-format *out* " q~D -> X~D ;~%" (:index q) (:index q))) (when (:initial q) (cl-format *out* " H~D [label=\"\", style=invis, width=0]~%" (:index q)) (cl-format *out* " H~D -> q~D;~%" (:index q) (:index q))) (doseq [[next-state transitions] (group-by second (:transitions q)) :let [type-desigs (map first transitions) labels (if abbrev (for [td type-desigs] (cl-format false "t~a" (abbrevs td))) type-desigs) label (str/join "," labels)]] (cl/cl-cond ((and (member (xym/state-by-index dfa next-state) sink-states) (not draw-sink))) (:else (cl-format *out* " q~D -> q~D [label=\"~a\"];~%" (:index q) next-state label)))))))))
of course I can prepare a test case, but just wondering whether there's something obvious going wrong???
nothing that i see. one debugging tool that helps is to turn on m-x nrepl-toggle-message-logging
and try your action again. and then check the buffer that is created with all nrepl traffic in it
https://docs.cider.mx/cider/1.1/troubleshooting.html#debugging-the-communication-with-nrepl
thanks. the message was very helpful.
(<--
id "80"
session "170ac8a8-6e7f-4f1c-8e25-072c26cc6753"
time-stamp "2021-07-26 21:53:05.597508000"
err "java.lang.Exception: No namespace: clojure-rte.dot found
at..."
ex "class java.lang.Exception"
pp-stacktrace ((dict "class" "java.lang.Exception" "message" "No namespace: clojure-rte.dot found" "stacktrace"
((dict "class" "clojure.core$the_ns" "file" "core.clj" "file-url" "jar:file:/Users/jnewton/.m2/repository/org/clojure/clojure/1.10.0/clojure-1.10.0.jar!/clojure/core.clj" "flags"
("clj")
"fn" "the-ns" "line" 4162 "method" "invokeStatic" "name" "clojure.core$the_ns/invokeStatic" "ns" "clojure.core" "type" "clj" "var" "clojure.core/the-ns")
I was trying to macro expand in a buffer, but I'd never loaded the actual file into VMif so that's a good CIDER bug. Perhaps the error handling isn't hooked up to the macroexpand stuff?
once I loaded the code, the macro expansion works correctly.
right. i'm interested in why you didn't get this error message immediately and could easily diagnose your problem. that is a CIDER bug
yes I'd expect a better error message reporting, indeed
I guess the macro expansion created code with namespace notation such as clojure-rte.dot/some-function-name
and then tried to read that back in in order to format or pretty-print the output. but reading failed because of missing namespace ?