This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2024-01-02
Channels
- # announcements (7)
- # atom-editor (3)
- # babashka (8)
- # beginners (38)
- # biff (5)
- # calva (17)
- # cider (26)
- # clj-kondo (6)
- # clojure (49)
- # clojure-europe (47)
- # clojure-norway (19)
- # clojure-sweden (2)
- # clojure-uk (1)
- # clojurescript (22)
- # cursive (20)
- # datahike (1)
- # datomic (6)
- # etaoin (2)
- # honeysql (2)
- # hyperfiddle (36)
- # jobs-discuss (19)
- # leiningen (15)
- # malli (5)
- # off-topic (8)
- # overtone (1)
- # pathom (15)
- # pedestal (8)
- # polylith (4)
- # releases (1)
- # ring (5)
- # schema (10)
- # shadow-cljs (17)
- # timbre (3)
- # xtdb (17)
So I use cider-jack-in
to start a shadow-cljs
repl in Doom Emacs, then when I go to eval a file, I'm seemingly hung on a "Loading .../app.cljs" message in the minibuffer. I'll get a REPL at the bottom of my window, but I can't send anything to it. Anything I should do? I started with the quickstart code for Shadow CLJS here: https://github.com/thheller/shadow-cljs?tab=readme-ov-file#quick-start
I sort of recall that working in conjunction with a running browser to actually run the js
you can search the quick start above for "browser" to find it talking about the html page you load in the browser, and it talks about using npx commands to start repls, dunno how any of that works with cider-jack-in
hmm ok, yes scrolling up in the REPL buffer shows some additional info like what the address of the dev http server is... But now I'm seeing that the shadow-cljs connect fails because the server might be dead? Maybe I do need to have a watch process going
I'd suggest to spawn a nrepl server from the CLI, that way you'll see exactly what's going on. It's generally more robust and debuggable.
Then you can cider-connect-clj&cljs
from Emacs
Make sure to have the different moving pieces (shadow, cider-nrepl, cider.el) at their latest stable versions
Thanks I'll try that next. I'll need to (unpin! cider-nrepl)
and others I believe. I'm using Doom
What I'm really after is getting CLJS autocomplete in my Emacs buffer. It works when jacking-in to Clojure nREPL but I don't get autocomplete with ShadowCLJS
Solved, I setup an explicit :nrepl
key in my shadow-cljs.edn
file and added cider-nrepl middleware. Thanks everyone 🙂
I'd like to have a deps.edn
alias for running tests with clojure.test/run-tests
, but it seems that the :exec-args
only expects a map? I tried a few variants, but they all result in some class cast errors. Do I have to provide my own function just for that?
You might want to check out https://github.com/cognitect-labs/test-runner
Thought that something like that would be my next step anyway. But as a general question — one can only run a function with a single map arg this way, is that correct?
hi there, out of curiosity is there a way to compile to wasm from clojure ? or is there any plans to have it as a target ?
(Resolved)
Hi there 👋 , I'm facing a challenge on a very simple task, and I need some guidance.
I have two lists:
1. Invited users
2. Registered users (a sublist of the first)
I want to have the list of invited users that didn't register. How I can do it? I tried it with filter
and with reduce
but no success
Can you share what you tried? It will be easier to give better feedback that way.
(def invited ["" ""])
(def registered [""])
(def not-registered (filter (fn [r] (not(some #(= r %) invited))) registered))
(def not-registered-reduce (reduce (fn [final register]
(into final (if (some #(= register %) registered) invited)))
registered))
Here's an example just using reduce
(let [a ["foo" "bar" "baz"]
b ["bar" "baz"]]
(reduce (fn [acc av]
(if (not (some (fn [bv] (= bv av)) b))
(conj acc av)
acc)) [] a))
Oh... I do need to get familiar with the standard library
Thank you @U02FVPF04A1 and @U7RJTCH6J ❤️
Clojure has an amazing community
and humble 😜
Hi! Can someone let me know why this returns the error "Cannot call 1 as a function"?
(for [x (1,22) y (1,44)] (+ x y))
But this code runs fine?
(for [x [1,22] y [1,44]] (+ x y))
if you want you should be able to write ("quoting" the lists):
(for [x '(1,22) y '(1,44)] (+ x y))
put a different way, if you enter [1 22]
into a repl, you'll get back [1 22]
, but if you enter (1 22)
at a repl, you'll get the same error
ok, that makes perfect sense, thanks!