This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-07-27
Channels
- # babashka (35)
- # beginners (85)
- # cider (14)
- # clojure (115)
- # clojure-europe (15)
- # clojure-norway (2)
- # clojure-portugal (9)
- # clojure-uk (3)
- # clojurescript (28)
- # conjure (35)
- # data-science (10)
- # datomic (4)
- # graalvm (28)
- # holy-lambda (7)
- # hyperfiddle (2)
- # jobs (2)
- # joker (4)
- # malli (9)
- # meander (6)
- # nbb (6)
- # off-topic (23)
- # pathom (3)
- # remote-jobs (1)
- # shadow-cljs (158)
- # sql (15)
- # tools-deps (35)
- # vim (5)
A while ago someone started some initiative for climate- and environment-related clojure-jobs and things alike. I can't find it anymore. This still alive? Where?
I desire a tool that
(let [foo (get-foo)
bar (get-bar foo)]
..
)
lets me hover on "foo (get-foo)" eval and def it.
Really just quickly doing (def foo (get-foo))
which is what I currently doas the next thing,
(let [_ (def foo (get-foo))
_ (def bar (get-bar foo))]
..
)
turn it into thisIt turns out that you can be even more aggressive about evaling clojure code since it's mostly pure and lazy
Do you want to def
because you want to see the value or because you want to use the value somewhere else?
What editor are you using?
you can view the value with M-x cider-inspect
or C-c M-i
. once you view it, you can optionally def with M-x cider-inspector-def-current-val
or d
in the inspector view.
obviously, you can streamline it as much as you like with a bit of elisp
I have a key binding in VS Code that if you highlight the symbol and expression in a let
binding, it will def
that for you as a global. It's a custom REPL snippet that evals (def $selection)
so it's pretty mindless.
I can put the cursor in front of the symbol and do ctrl+shift+right ctrl+shift+right ctrl+alt+space d
@U04V70XH6 sounds cool, is this supported by Calva or did you write some joyride code?
It's a custom REPL snippet so it's "just" Calva. My only two Joyride scripts right now are to display Clojure/Java documentation directly in VS Code (via the built-in Simple Browser).
If Joyride could auto-sync scripts between machines somehow, I'd convert more of my custom REPL snippets to run Joyride scripts (so I could use code for the more complex ones instead of "just strings").
Meh, I already have that and manually sync those Joyride files. But I like the convenience of editing a custom REPL snippet on one machine and having it just work automatically on another machine "immediately" š
@U02CV2P4J6S you said you are not currently using emacs and, at the same time, that your editor is Emacs? š. Anyway, as already mentioned, cider inspector can do that and you can also use it while https://docs.cider.mx/cider/debugging/debugger.html There are also tools like these that can do that for you: ā¢ https://github.com/Saikyun/miracle.save ā¢ https://github.com/vvvvalvalval/scope-capture Finally, you can use a simplo macro to do the job: https://github.com/jumarko/clojure-experiments/blob/master/src/clojure_experiments/debugging.clj#L80-L99
(defmacro locals []
(let [ks (keys &env)]
`(let [ls# (zipmap '~ks [~@ks])]
(println "====================== DEBUG locals =======================")
(clojure.pprint/pprint ls#)
(println "====================== END DEBUG locals =======================")
(def my-locals ls#))))
thanks I check it! @U06BE1L6T I use emacs but not irc -- a lol I just misunderstood
@U7RJTCH6J what is that gif from?
@U03DPUQ1LJV, it's an experimental tool that I'm working on