This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
- # adventofcode (31)
- # announcements (6)
- # babashka (5)
- # beginners (93)
- # calva (15)
- # cider (20)
- # cljs-dev (16)
- # clojure (159)
- # clojure-berlin (1)
- # clojure-dev (5)
- # clojure-europe (9)
- # clojure-italy (9)
- # clojure-losangeles (2)
- # clojure-nl (26)
- # clojure-spec (7)
- # clojure-uk (33)
- # clojurescript (54)
- # clojutre (5)
- # cursive (20)
- # datomic (23)
- # emacs (19)
- # events (1)
- # expound (1)
- # figwheel-main (1)
- # fulcro (104)
- # hyperfiddle (1)
- # jobs (1)
- # luminus (10)
- # malli (59)
- # nrepl (1)
- # off-topic (11)
- # pathom (5)
- # planck (15)
- # reagent (13)
- # reitit (8)
- # rewrite-clj (10)
- # ring-swagger (3)
- # shadow-cljs (129)
- # tools-deps (46)
- # xtdb (14)
- # yada (1)
Hi guys, I recently bought the Programming Clojure book and there is this code example
But I am not sure what is the
(defn preds-seq  (->> (all-ns) (map ns-publics) (mapcat vals) (filter #(clojure.string/ends-with? % "?")) (map #(str (.-sym %))) vec))
.-symfunction, I couldn’t fine any docs about it. Does anyone has an idea what function is that? Thanks!
. Is Java interop for either method or field access - if both exist, the method takes precedence. .- is field only.
since the book came out, there's a new arity of
symbol that actually makes the field access here unnecessary
(->> (all-ns) (map ns-publics) (mapcat vals) (filter #(clojure.string/ends-with? % "?")) (map symbol) vec)
well almost - depends on whether you want symbols or strings at the end
that looks like clojurescript interop where
.-xxx means read a property of xxx from the object
it's valid in all flavors of clojure, but it's more interesting in cljs because in clj the object can't have a method and property that share the same name (unlike cljs where it can)
Hi, functions that cause side-effect are suffixed
!, functions that accept varargs are suffixed
*. Is there a convention for a function that is both?
i'm not certain function names suffixed with
* have that meaning. https://stackoverflow.com/a/5084289
I saw someone use
*name to describe an atom/ref/agent, and I've started to pick up that habit. It's not particularly widespread though
I picked this up from
Pedestal. http://pedestal.io/api/pedestal.interceptor/io.pedestal.interceptor.chain.html See
more often i've seen
foo* being used to describe an "uglier" interface to
foo but not private because it may still be useful to users
N00b clojurian here! I saw "Clojure cookbook" which I will definitely grab, but what would be the canonical book for the language itself (ideally with plenty of fp & lisp theory)? And any coljurescript books that are cookbook style? Any recommendations would be greatly appreciated!
Does httpkit+compojure enough for developing rest api or I need use any framework?
@artur.aralin97 I hadn't used either, I'm new to Clojure. But what I do know is this; when learning a new technology, walk the path most travelled. With that many GitHub stars, adoption by popular frameworks/libraries tells me that's the best approach.
Hi guys. Please help. Trying to make my first project with clojurescript, but I'm stuck a bit with tooling. Started from this example https://github.com/jacekschae/learn-re-frame-course-files/tree/master/increments/60-simplify-events Can't configure a stable dev environment, especially REPL. Can someone point me to a good tutorial? Or just name the right tools, I'm totally lost for now. (lein, boot, deps, figwheels, shadow-cljs, proto-repl, chlorine etc) I use windows 10 / java 11 (adopt-openjdk) and Ubuntu. Need setup for both.
I have build this example repo for my teammates, you can just clone it and follow the instructions: https://github.com/ReOrgpad/example-client
For installing Shadow-cljs, you just need NodeJS (npm) and run npm install -g shadow-cljs.
I would also recommend to invest into some IDE with build in REPL support, we personally are using IntelliJ and Cursive and it is great.
Can somebody tell me, why the following code does not throw an exception?
(do (for [x (range 4)] (throw (RuntimeException.))) nil)
But the following still does not throw an exception:
(doall (for [x (range 4)] (throw (RuntimeException.))) nil)
It is different:
(do (doall (for [x (range 4)] (throw (RuntimeException.)))) nil)
I've created a beginners guide for using Cursive and Intellji in Clojure: https://adriansmith.io/clojure-setup.html I created it for a local group I'm teaching but it might be useful to others, source code is in https://github.com/slifin/adrian-smith-io if you have improvements
hey everyone. Is there a simple way I can use back tick without name space resolution (and without resorting to macros)? i.e. Instead of
`(fn  ~(inc 1)) => (clojure.core/fn  2)
=> (fn  2)
I could tree walk this and replace the fully resolved name with a simple name, but maybe there's a simpler way
hey everyone. anyone have opinions on an emacs distribution that will work on linux?
preferabbly one that feels like atom/vscode (my original goal was to clojure without emacs at all. that doesnt look likely or practical though)
spacemacs and doom-emacs are the two most popular with vim keybindings, both should run fine on linux
Spacemacs in Holy mode and with Ivy. It's not exactly VSCode like, in that some shortcuts are different like copy/paste and how selection works. But it's close. You could enable CUA mode to make it even more like VSCode
why would you choose Ivy over Helm? I've been using Spacemacs with Helm for the past 4 years and didn't have a problem with it yet. Is Ivy much faster? Or does it have a better interface?
@prakash You can definitely use Clojure without emacs - I use Cursive, and there are addons for both atom and vscode
@shaun-mahood thanks for the rec! iv never heard of Cursive, but ill check it out
While I'm an Emacs lover, it is a lot to learn. If you're also learning Clojure, the advice to try Cursive (IntelliJ), Calva (VSCode) or Chlorine (Atom) is probably a good one.
I'd be delighted if you gave Calva a spin. It definitely fits the prepackaged description. (No debugger though, but that will happen eventually.) #calva-dev is where we try to be the helpful bunch that you are used to in the Clojure community.