Fork me on GitHub

When I execute clojure code (require '[ :as repl]). I got error:

FileNotFoundException Could not locate clojue/tools/nrepl__init.class or clojue/tools/nrepl.clj on classpath.  clojure.lang.RT.load (
How to fix this?


@stardiviner Put an r in clojue to make clojure...


Thanks. I missed that, sloppy me.


what is the idiomatic way to make a stateful value (database connection) accessible to all the namespaces without passing it down as function argument?


The idiomatic way is to pass it

👍 4

@veix.q5 I agree with @U064X3EF3, but some people prefer the approach taken by Mount: Again, I don't recommend that - one more function argument is an insignificant cost, and allows for reifying the environment and making environmental dependencies explicit.

❤️ 1

yeah, I am not one of those people :)


thanks for clearing this up for me, much appreciated



Vincent Cantin04:05:35

if you have multiple environment states that you want to pass, you may also consider passing a map that contains them all and call it something like env.


You can set this connection as def in some namespace. And when you need it from another namespace just use :require [db.ns :refer [my-connection]

✔️ 1

@veix.q5 I'd argue the idiomatic way is to pass it down as a function argument. Either as a single argument or as an entry in a map. Non-idiomatic would be storing it in a var for instance. Or you could use something like mount or DIME

👍 4

You also might want to use something like component or mount for organization that kind of statefull components


Hi everyone! Does anyone know if a Clojure headless CMS exists?


I would like to return the first item matching a regex. Here is what I have so far:

(first (filter #(re-find #"something = (\d+)" mydata))) 
;; "some matching thing without the items being grouped by regex match"


I guess I could use map instead, and then pass that to filter, or is there a more idiomatic way?


I've got zero experience with Java and have difficulties assessing a h2 database from a luminus project. When tried:

java -tcp -tcpPort 9091 -baseDir ~/prog/clojure/orio/ 
Error: Could not find or load main class


To start H2 as a server, I think you want java -jar path/to/h2.jar -various -options


But you should be able to have it run in memory, without needing to start an external server instance.


@seancorfield I'd like to assess it from a client in order to check what I have there and to test some queries


@lum Something to consider is starting your Luminus app from inside the REPL, and then also using the REPL to run queries etc.