Fork me on GitHub
Willem Hoogland08:12:15

I just started with clojurescript and created a reframeproject. Now I am getting this error message when starting a REP. The required namespace "react-dom" is not available, it was required by "reagent/dom.cljs".


are you using shadow-cljs?


This sounds like you need to installl your react deps either via npm or yarn.

☝️ 2

Hi everyone, Suppose I write a custom class loader ... how can I make my JVM to add this class loader to its hierarchy of classloaders ? (Also are there any special concerns I need to address while using Clojure compared to Java when setting custom class loaders ?) Thanks a lot ----- This is sort of a follow up question to this


There is no problem asking your question here, but I will point out that as soon as you are asking questions about Java classloaders, you are probably past beginner territory 🙂


The channels #clojure and/or #java on this Slack community might be better target audiences for such a question.


or even #clojure-dev - as one of the key parts of how clojure works is maintaining an updated classloader that keeps up with all your new definitions as they are compiled


How can we convert below java code in clojure?

int m = (1 << n);
        for (i = 0 ; i < m ; ++i) {
            int bits[] = new int[n];
            for (j = 0; j < n ; ++j) bits[j] = 0;
            j = 0;
            int x = i;
            while (x != 0) {
                bits[j] = x & 1;
                x = (x >> 1);
            int sum = 0;
            for (j = 0 ; j < n ; ++j) {
                if (bits[j] == 1) {
                    sum -= arr[j];
                else {
                    sum += arr[j];
            if (sum % k == 0) {
                good = true;


This has array used, how can I better this in clojure way ?


Looks like a straight port of some C code, it zeros a newly allocated array, which java already does


Usually it is better to take a step back from the code, and ask what the code does, and do that vs mechanical porting


a little late but for everyone a merry X-mas

🎄 2