This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-06-29
Channels
- # announcements (6)
- # beginners (110)
- # calva (18)
- # clj-kondo (19)
- # cljs-dev (27)
- # clojars (10)
- # clojure (38)
- # clojure-art (2)
- # clojure-europe (13)
- # clojure-germany (1)
- # clojure-norway (26)
- # clojure-uk (2)
- # clojurescript (10)
- # conjure (9)
- # cursive (12)
- # data-science (3)
- # datomic (22)
- # emacs (8)
- # helix (9)
- # honeysql (18)
- # introduce-yourself (1)
- # jobs (1)
- # leiningen (8)
- # lsp (22)
- # missionary (9)
- # nbb (11)
- # off-topic (83)
- # pathom (5)
- # pedestal (4)
- # polylith (1)
- # portal (1)
- # re-frame (3)
- # reitit (15)
- # remote-jobs (1)
- # rum (4)
- # shadow-cljs (88)
- # specter (12)
- # testing (1)
- # vim (39)
Hi. What’s the difference between these two lines. Seems they are merely altering the place.
That is what retrying does, if there is an error loading a given namespace, that namespace is left in the queue so it is reloaded again the next time a reload is triggered
I'm looking at the code for timbre (specifically, [this line](https://github.com/ptaoussanis/timbre/blob/master/src/taoensso/timbre.cljc#L778) ) and I'm very confused by the &form
, where does this thing come from? What is it?
FlowStorm debugger 2.2.99 is out with new features FlowStorm is a Clojure and ClojureScript debugger. Last release (2.2.99) includes a bunch of new features, and fixes : • Browser now support instrumentation/uninstrumentation of vars and namespaces (single and multiple) • Instrumenting from the repl synchronize with the browser (for everything but #trace) • Added a context menu on locals to define vars from values • Added jump to first and last traces on thread controls (useful for exceptions debugging) • Added print-level and print-meta controls on pprint value panels • Improve re-run flow UX • Namespace instrumentation now accepts :verbose? to log known and unknown instrumentation errors details • Added flow-storm.api/uninstrument-forms-for-namespaces to undo instrument-form-for-namespaces instrumentation • Added #rtrace0 ... #rtrace5, like #rtrace but with different flow-ids • Added double clicking on flows functions window to execute show-function-calls If you have any questions or ideas, there is the #flow-storm slack channel now! Github repo : https://github.com/jpmonettas/flow-storm-debugger/ Cheers!
oh yeah, will do it! thanks @U47G49KHQ
Deleted from #clojure since announcement don't belong here. There's also #releases for small/repeated updates to libraries. #announcements is intended for major releases and we encourage folks to only post there once a month at most.
np, sure, didn't knew about that @U04V70XH6
Hi all, does anyone have any experience with a project that is primarily clojure but has some kotlin code mixed in? Think I just don’t understand how to compile kotlin source so that my clojure code can pick it up. This may be a bad idea. Just have a PoC that I am working on and while I could write some Java interop, I’d rather use Kotlin.
this might be useful - https://kotlinlang.org/docs/java-to-kotlin-interop.html
This good. I think what I need to figure out is how to use clj build tools to compile kotlin in my local source folder so that I can import
it in my clojure code.
One option would be to compile kotlin sources into a jar and include this jar into deps.edn as a local dependency using :local/root
@U9EAK7JJG or you can add maybe on your deps.edn :paths ["src" "kotlin-classes-folder"]
, that should bring all compiled classes into your classpath. I guess that depends on how frequently you are recompiling the kotlin sources
Oh really! Ok that is more of what I was looking for. I'll give that a shot. I didn't think it could be that simple
I know everything you put there will end up in your classpath, but haven't tried it myself
There is one problem with both solutions - after recompiling you have to restart your repl to ensure classes are not cached. I don't think there is an easy way to have hot reloading
well just to circle back, I never did find a way to make this completely “just work”. I added the src directory, I manually compiled kotlin files, etc. Cursive even had autocompletion for my kotlin classes. However, I had issues: • I couldn’t access Kotlin files in the repl (even after I compiled them and sent them to target). The URLClassLoader couldn’t find them. • I had some classpath issues getting the Kotlin compiler to see libraries I pulled from deps.edn. I think once I figure out the claspath this can be resolved. Perhaps if I took some time to investigate how Corfield built his java build functionality I can do the same for kotlin.
damn, maybe the easiest then is just pack kotlin classes into a jar and then just reference it with :local/root in deps.edn then. You can create a script to do all that, and will have to restart the repl after changing kotlin files but that should work
or you can go all in and try to figure out the classloaders issues, which sounds like a nightmare
I’m working with c3p0 connection pooling. I want to add a ConnectionCustomizer
to monitor the lifecycle of connections. The library wants that to be passed by class name as a property and then it instantiates it. So I’m registering it as "connectionCustomizerClassName" (.getName ConnectionCustomizer)
where ConnectionCustomizer
is a defrecord
implementing the interface. Yet when c3p0 is calling Class.forName( className ).newInstance();
it is throwing a java.lang.ClassNotFoundException: metabase.driver.sql_jdbc.connection.ConnectionCustomizer
. I am able to construct a class in this manner: (.newInstance (Class/forName (.getName ConnectionCustomizer)))
so I suspect I have a classLoader issue. But I’m not sure how to resolve that issue. Does anyone have any pointers?
you can try setting the context classloader to whatever (clojure.lang,RT/baseLoader) returns
I’m not sure how to do that i guess. Their docs state: > To install a ConnectionCustomizer just implement the interface, make your class accessible to c3p0's ClassLoader, and set the configuration parameter below:
You can set a property contextClassLoaderSource
> Must be one of caller, library, or none. Determines how the contextClassLoader (see java.lang.Thread) of c3p0-spawned Threads is determined. If caller, c3p0-spawned Threads (helper threads, java.util.Timer threads) inherit their contextClassLoader from the client Thread that provokes initialization of the pool.
I’ve set this to caller
explicitly and it still doesn’t seem to work
you then need to use https://docs.oracle.com/javase/7/docs/api/java/lang/Thread.html#setContextClassLoader(java.lang.ClassLoader) to set the context classloader on thread where c3p0 is called to a classloader where clojure stuff defined dynamically is visible, like the one returned by RT/baseLoader
what is the best practise for modelling hierearchical one-parent<->many-children relationships in datomic-likes? we could put the attribute on either side, I see that the guidance is to only put it on one side which makes sense, the few examples I can find seem to always have it on the child. References to good material also appreciated