This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-04-09
Channels
- # announcements (1)
- # architecture (20)
- # aws (22)
- # babashka (41)
- # beginners (191)
- # chlorine-clover (66)
- # cider (19)
- # clj-kondo (54)
- # cljs-dev (15)
- # cljsrn (78)
- # clojars (1)
- # clojure (148)
- # clojure-android (4)
- # clojure-europe (7)
- # clojure-gamedev (15)
- # clojure-germany (6)
- # clojure-losangeles (46)
- # clojure-nl (23)
- # clojure-survey (3)
- # clojure-uk (46)
- # clojurescript (24)
- # conjure (21)
- # cursive (21)
- # data-science (11)
- # datomic (5)
- # events (2)
- # fulcro (28)
- # garden (32)
- # joker (2)
- # kaocha (6)
- # lambdaisland (4)
- # mount (2)
- # off-topic (11)
- # pathom (10)
- # pedestal (13)
- # re-frame (7)
- # shadow-cljs (15)
- # spacemacs (21)
- # specmonstah (1)
- # wasm (1)
- # windows (1)
- # xtdb (37)
@mitchell_clojure I think @qythium had some version of eval-in-context
which would infer the local bindings.
cool, thanks all. Might be a good way to learn elisp
@mitchell_clojure Hey I just saw the mention, here's my custom fn:
(defun cider--guess-evaluation-context ()
"returns list of let-binding strings from the inside out, without closing parens
\"(let [...]\""
(save-excursion
(let ((res ()))
(condition-case er
(while t
(backward-up-list)
(when (looking-at (rx "(" (or "when-let" "if-let" "let") (opt "*")
symbol-end (* space)
(group "["))) ;; binding vector
(let ((beg (match-beginning 0))
(end (save-excursion
(goto-char (match-beginning 1))
(forward-sexp 1)
(point))))
(push (buffer-substring-no-properties beg end) res))))
(scan-error res)))))
(defun cider-eval-dwim ()
(interactive)
(let ((ctx (cider--guess-evaluation-context))
(bounds (cider-sexp-at-point 'bounds)))
(cider-interactive-eval (concat (apply #'concat ctx)
(buffer-substring-no-properties (car bounds) (cadr bounds))
(make-string (length ctx) ?\)))
nil bounds
(cider--nrepl-pr-request-map))))
cider-eval-dwim is the interactive command, bind it to something convenient and it'll automatically splice the form you're evaluating with all its enclosing let forms
it's still in a somewhat rough state, I'll use it myself for a while more before deciding whether to contribute it upstream (maybe as part of cider-eval-in-context)
woah, sick! thank you very much. I'll incorporate this in my workflow and let you know if I come up with any interesting tweaks
That’s a pretty cool news - our sibling project Calva has implemented cider-nrepl’s debugger https://clojureverse.org/t/calva-gets-a-debugger/5751 Now we know for sure that CIDER’s debugger is editor agnostic! 😄
What's the recommended way to have all the necessary cider deps in a REPL when the REPL is started remotely or outside cider?
I have to jack in to some local project, see what it injects, it injects multiple things,then I have to modify my project.clj with all of it, and I have to keep up with this as I update cider
Is this the usecase for nrepl's sideloading feature?
Ouuu! Hope so! I think it might, you'd just depend on nrepl
and everything else can be side loaded