This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
- # announcements (3)
- # babashka (60)
- # beginners (29)
- # calva (24)
- # cider (1)
- # clj-kondo (18)
- # clj-new (5)
- # cljs-dev (1)
- # clojure (30)
- # clojure-czech (1)
- # clojure-europe (23)
- # clojure-france (3)
- # clojure-germany (2)
- # clojure-uk (3)
- # clojurescript (19)
- # conjure (9)
- # crux (12)
- # data-oriented-programming (5)
- # defnpodcast (1)
- # expound (1)
- # fulcro (26)
- # helix (4)
- # integrant (1)
- # jackdaw (77)
- # malli (1)
- # music (2)
- # off-topic (16)
- # other-languages (6)
- # portal (5)
- # quil (5)
- # re-frame (1)
- # shadow-cljs (7)
- # spacemacs (7)
- # vim (5)
if-some looks neat. https://clojuredocs.org/clojure.core/if-some when would one use it instead of
if-let treats both
nil as negative conditions.
if-some only treats
nil as a negative condition.
So if you have an expression that can yield truthy,
nil, where the first two are useful values and the third means “no result”, then you want
if-some rather than
dev=> (if-let [x false] x :nope) :nope dev=> (if-some [x false] x :nope) false
Is there a way to list all namespaces in the REPL when using ClojureScript? The equivalent of all-ns in Clojure
There's https://github.com/clojure/clojurescript/blob/5091bab07e8e60f64d06e43bf07ba08204071b0d/src/main/clojure/cljs/analyzer/api.cljc#L212, but that is only useful if you need that information in Clojure (and maybe self-hosted ClojureScript -- not sure). What are you trying to do?
Is there a cleaner and/or more idiomatic way to say this?
edit: generalized the example a bit for n keys
(filter #(and (= (:k1 %) (:k1 a-map)) (= (:k2 %) (:k2 a-map)) ... (= (:kn %) (:kn a-map))) coll-of-maps)
select-keys is probably the right answer here, unless you specifically want a set as a result.
Hi I am working on https://github.com/metabase/metabase project, It is a leiningen project and I am trying to using debugger on it after running project with `lein run` I installed calva on vscode and tried some steps to set up debugger, but I was out of luck I would be grateful if you tell me steps required to set up debugger 🙏
You will probably have better luck getting an answer over at #calva. Make sure you describe what being "out of luck" means specifically. Also, check out https://calva.io/debugger/.
I am using vscode+calva. So far no issues having fun hacking clojure, except for one really annoying thing. clj-kondo is drawing sqiggly lines across many useful macros and makes the entire code ugly. I tried configuring it but failed. I created a .clj-kondo folder in project root and added config.edn. The below is my simple attempt to exclude deftest
@code.komali You should not have to do that, clj-kondo is aware of all built-in clojure macros. It's likely that something else is wrong.
Please lint your code on the command line with the
clj-kondo command line tool to see if you get any unexpected errors.
If not, then it's a downstream tooling problem. Pasting a screenshot might also help. Come talk in #clj-kondo or #calva to discuss further problems.
I'm pretty sure i also get squiggle on deftest with cava. I assumed it just wasn't supported. Will check when i get home.
Thanks @borkdude I'll try doing that. But, even if the command line linting worked. I am very happy with calva. Hope the calva creator(s) do something about this.
Of course. This is just a way of finding out where the problem is. It should be resolved.
My ns is like this:
(ns asm.parser-test (:require [clojure.test :refer :all] [asm.parser :refer :all]))
oh yeah! If I change it to
It removes the wiggles, thanks!
(:require [clojure.test :refer [deftest testing is]])
then it will also work (I just realized this answering a similar question in #clj-kondo)
mkdir -p .clj-kondo clj-kondo --lint src:test --dependencies