This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
- # announcements (1)
- # beginners (40)
- # calva (30)
- # cider (3)
- # clj-kondo (1)
- # cljdoc (12)
- # clojure (79)
- # clojure-dev (7)
- # clojure-france (4)
- # clojure-spec (10)
- # clojure-uk (13)
- # clojurescript (19)
- # core-async (1)
- # core-typed (1)
- # cursive (2)
- # datomic (2)
- # emacs (3)
- # events (1)
- # kaocha (2)
- # klipse (14)
- # off-topic (26)
- # pathom (1)
- # reagent (8)
- # rewrite-clj (8)
- # shadow-cljs (22)
- # tools-deps (18)
For a key binding like this: ctrl-, f': 'chlorine:load-file' , just hit 'ctrl' then 'b' as usual ?
The suggested key bindings for Atom, it is actually a little weirder than that: ctrl-, means to hold down the Control key while typing the comma key. Let both go, then type f.
You can of course choose other key bindings if you wish, but might want to experiment with the suggested ones for a little while first and see if they grow on you or not.
There are https://clojureverse.org and https://www.reddit.com/r/Clojure that I am aware of. There is a Clojure Google group, but I think a lot of the activity has moved away from there over the last several years to other places.
quick question: is there a way to make
dissoc on a Record return a version of the record with
nil as the value, instead of converting to a map?
Nothing built in that I am aware of. You can use assoc with a value of nil to do so.
Sean Corfield has recorded a few screencasts recently to demonstrate one possible work flow that takes advantage of REBL. I know he really finds it productivity-enhancing, so I'm inclined to look further myself some time, hopefully soon.
Given my current lack of knowledge about it, I would say you don't need to learn to use it in order to learn Clojure, and there are plenty of things to learn other than that if you are new to the language, so don't feel you have to tackle that right from the start.
Agreed. REBL is great once you have already internalized a REPL-driven workflow, and you want better visualization of results than the REPL can provide. Until you're at that point, don't worry about it.
what is the purpose of
on a Symbol in function position? E.g.
. I found that in a let here and am trying to grasp the implications: Lines 88, 97 and 107 in https://github.com/fulcrologic/fulcro3/blob/develop/src/test/com/fulcrologic/fulcro/algorithms/indexing_spec.cljc#L88
(#'idx/index runtime LinkChild)
its a reader macro that expands #'foo to (var foo) https://clojuredocs.org/clojure.core/var
this returns the var itself. ie. doesn't evaluate the passed in thing and return its value
The symbol won’t resolve (because it’s private) but the var is always public
And invoking a var that refers to a function will invoke the function
Peeps, I desperately need some help resolving a specific issue. I've written some code that generates a map. Like so:
Then, I not only wanted to map
(zipmap keys (map f keys))
fbut also with
However, exeuting that code in the REPL gives me:
(zipmap keys (map (comp g f) keys))
What does that mean? I have no clue what to do. If I call
Syntax error (NullPointerException) compiling at (form-init6822426521249811109.clj:1:8). null class clojure.lang.Compiler$CompilerException Show: NoneClojureJavaToolingDuplicates Compiler.java: 3707 clojure.lang.Compiler$InvokeExpr/eval Compiler.java: 457 clojure.lang.Compiler$DefExpr/eval Compiler.java: 7181 clojure.lang.Compiler/eval Compiler.java: 7131 clojure.lang.Compiler/eval core.clj: 3214 clojure.core/eval core.clj: 3210 clojure.core/eval main.clj: 414 clojure.main/repl/read-eval-print/fn main.clj: 414 clojure.main/repl/read-eval-print main.clj: 435 clojure.main/repl/fn main.clj: 435 clojure.main/repl main.clj: 345 clojure.main/repl RestFn.java: 1523 clojure.lang.RestFn/invoke interruptible_eval.clj: 79 nrepl.middleware.interruptible-eval/evaluate interruptible_eval.clj: 55 nrepl.middleware.interruptible-eval/evaluate interruptible_eval.clj: 142 nrepl.middleware.interruptible-eval/interruptible-eval/fn/fn AFn.java: 22 clojure.lang.AFn/run session.clj: 171 nrepl.middleware.session/session-exec/main-loop/fn session.clj: 170 nrepl.middleware.session/session-exec/main-loop AFn.java: 22 clojure.lang.AFn/run nil: -1 java.lang.Thread/run
gon some value of the map, that works out fine.
Ah! Got my first hint. Apparently, this issue comes from me wrapping said code execution in a
(def v (call-to-my-f with-an-arg). If I just do
(call-to-my-f with-an-arg) in the REPL, the exception becomes clearer :thinking_face:
it's not obvious, but those are two different paths in the compiler
No, that was alright. I just didn't know how to interpret that specific exception. And now I'm wondering why
(def v (f x)) gives me a different exception than
(f x) in the REPL.
the former does an eval path while the latter will compile and then invoke. the exception handling is a little different. I'd be curious what the differences were. (there was actually a fix in this area in 1.10.1 so in particular wondering if you're on that)
My Clojure repo. looking for tips / advice / critiques ... on my structure, what to keep , what to ignore ... https://github.com/paulgureghian/Clojure
(:gen-class) expressions within the
ns forms are only needed in fairly specific circumstances that you may not have encountered yet. I do not know if there are any circumstances where they can add confusing behavior, but certainly seems simpler to leave those out if you are not in a situation where it is necessary.
Your core.clj file contains a call to a function
(hello-clojurians) that will cause that function to be called every time that file is loaded. Occasionally you do want such side effects just from loading a file, but again, maybe best to comment out that call in most situations.