This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-10-30
Channels
- # aleph (2)
- # announcements (4)
- # babashka (3)
- # beginners (89)
- # calva (12)
- # cljdoc (7)
- # cljsrn (5)
- # clojars (1)
- # clojure (19)
- # clojure-dev (6)
- # clojure-europe (2)
- # clojurescript (12)
- # conjure (7)
- # cursive (4)
- # fulcro (28)
- # graphql (6)
- # gratitude (2)
- # introduce-yourself (2)
- # jobs (1)
- # jobs-discuss (26)
- # off-topic (2)
- # pathom (22)
- # pedestal (2)
- # podcasts-discuss (10)
- # re-frame (9)
- # reitit (8)
- # releases (2)
- # remote-jobs (1)
- # shadow-cljs (1)
- # tools-deps (27)
- # xtdb (11)
I was just in a shibuya.lisp event. This guy showed a really cool project he was working on. It shows the code context with Clojure stacktraces. I can imagine that this would make debugging a bit easier. https://github.com/athos/stacktracer
Who knows, if this gets really good, maybe we can see it integrated into Clojure itself. I know I could’ve used this when just starting out.
If you overwrite clojure.main/repl-caught
like (alter-var-root #'clojure.main/repl-caught (constantly st/pst-for))
in your user.clj, you can get this rich error info as the default error message on the REPL.
Neat! The formatting reminds me a bit of how shadow-cljs reports compile-time issues (example https://shadow-cljs.github.io/docs/UsersGuide.html#infer-externs):
------ WARNING #1 --------------------------------------------------------------
File: ~/project/src/demo/thing.cljs:23:3
--------------------------------------------------------------------------------
21 |
22 | (defn wrap-baz [x]
23 | (.baz x))
---------^----------------------------------------------------------------------
Cannot infer target type in expression (. x baz)
--------------------------------------------------------------------------------
@U0508956F what are the mechanics of this? curious if i can get an equivalent thing working for plain ol’ java
@U3JH98J4R It's not that hard for Clojure. Clojure source code is just a resource on the classpath. You can read it just as an ordinary resource file (That's what clojure.repl/source
does internally).
But, I think it would require more to do the same thing for Java. You might have to decompile the bytecode to support third-party libraries.