/r/Clojure

Photograph via snooOG

Clojure is a dynamic, general-purpose programming language, combining the approachability and interactive development of a scripting language with an efficient and robust infrastructure for multithreaded programming.

Finding information about Clojure

API Reference

Clojure Guides

Practice Problems

Interactive Problems

Clojure Videos

Misc Resources

The Clojure Community

Clojure Books

Tools & Libraries

Clojure Editors

Web Platforms

Clojure Jobs

/r/Clojure

32,929 Subscribers

4

What framework or lib I should learn for web development ?

Hi guys
I have plan to use clojure as a fullstack web development.
I have some experience in reagent and reframe.
now I'm seeking for something fullstack.
this is for small to medium size project like a normal crud application.
I need something which can delivery project as fast as I can.
Could you guys recommend me something awesome please ?

0 Comments
2024/12/04
10:32 UTC

21

What features of Clojure do you like?

For me:

  • dynamic binding
  • desctructing
  • macro
  • java interop

PS: clojure = list + function + java/jvm,does this equation hold?

20 Comments
2024/12/03
16:06 UTC

2

How to make spec fdef work?

(require '[clojure.spec.alpha :as s])

(defn my-dec
  ([x] (my-dec x 1))
  ([x y] (- x y)))

(s/def :int/pos (s/and int? pos?))
(s/fdef my-dec
  :args (s/cat :x :int/pos :y :int/pos)
  :ret :int/pos)

(my-dec -1) ; expected to assertionerror but not now
7 Comments
2024/12/02
19:00 UTC

8

New Clojurians: Ask Anything - December 02, 2024

Please ask anything and we'll be able to help one another out.

Questions from all levels of experience are welcome, with new users highly encouraged to ask.

Ground Rules:

  • Top level replies should only be questions. Feel free to post as many questions as you'd like and split multiple questions into their own post threads.
  • No toxicity. It can be very difficult to reveal a lack of understanding in programming circles. Never disparage one's choices and do not posture about FP vs. whatever.

If you prefer IRC check out #clojure on libera. If you prefer Slack check out http://clojurians.net

If you didn't get an answer last time, or you'd like more info, feel free to ask again.

8 Comments
2024/12/02
11:01 UTC

55

Advent of Clojure

Advent of Code has started today.

Who is using Clojure to write the solutions? Share the links your repositories!

27 Comments
2024/12/01
17:54 UTC

24

Who is hiring? November 30, 2024

Please include any restrictions (remote/on-site, geographical, workpermit, citizenship) that may apply.

0 Comments
2024/11/30
23:00 UTC

5

Puzzled by prefix-tree routing in pedestal

Does anyone know why, using prefix-tree routing in Pedestal:

These work

"/posts"

"/posts/:year/:month/:day/*rest-of" ;"/posts/2024/11/29/17:02/foo"

But this doesn't (when added to a routing table with the above)

"/posts/:year/index" ;nil route for "/posts/2024/index"

But somehow this works (when added to the two working routes above)

"/posts/:year" ;"/posts/2024" correctly routed

I naively believed number of path segments would somehow distinguish routes from one another in prefix tree routing. I can't think of how else "/posts/:year" is successfully distinuished from "/posts/:year/:month/:day/*rest-of"". But then why doesn't "/posts/:year/index" work?

(I read through the PR that led to Pedestal's prefix tree router and the README for the go router that inspired it, but I still am not grasping why the above outcomes occur. Most of the Pedestal docs, which have become pretty great overall, seem to focus on the performance aspects of the router rather than how it works in practice.)

3 Comments
2024/11/29
22:12 UTC

5

Why clojure-lsp can't start in my neovim?

  • version
✦ ❯ clojure-lsp --version
clojure-lsp 2024.11.08-17.49.29
clj-kondo 2024.09.28-SNAPSHOT
  • :LspInfo
LSP configs active in this buffer (bufnr: 17) ~
- Language client log: ~/.local/state/nvim/lsp.log
- Detected filetype: `clojure`
- 0 client(s) attached to this buffer
- Other clients that match the "clojure" filetype:
- Config: clojure_lsp
  filetypes:         clojure, edn
  cmd:               ~/.local/bin/clojure-lsp
  version:           `clojure-lsp 2024.11.08-17.49.29`
  executable:        true
  autostart:         true
  root directory:    Not found.
  • :LspLog

Nothing...

It have already existed a deps.edn file and .git folder, but still told me "root directory: Not found".

9 Comments
2024/11/29
11:57 UTC

4

howt to stringify expr?

If I define macro like this;

(defmacro pp [expr]
  `(println (str expr) "=>" ~expr))

then expect to print result (+ 1 2) => 3 when call it with this:

(pp (+ 1 2))
16 Comments
2024/11/29
10:43 UTC

15

What code formatter do you use?

conform.nvim built-in suppport formatters:

  • cljfmt
  • cljstyle
  • joker
  • zprint
30 Comments
2024/11/28
18:02 UTC

19

The hidden costs of Clojure

1 Comment
2024/11/28
10:37 UTC

6

Swagger UI integration in Pedestal

Recently I was working on a backend service and I needed to integrate swagger UI with it. We use Pedestal for our routing. If anyone has any good way to do it.

4 Comments
2024/11/27
14:12 UTC

5

Any thoughts on using clojure in ktor

Ktor run on jvm, so they should be compatible out of the box?

4 Comments
2024/11/26
15:50 UTC

15

New Clojurians: Ask Anything - November 25, 2024

Please ask anything and we'll be able to help one another out.

Questions from all levels of experience are welcome, with new users highly encouraged to ask.

Ground Rules:

  • Top level replies should only be questions. Feel free to post as many questions as you'd like and split multiple questions into their own post threads.
  • No toxicity. It can be very difficult to reveal a lack of understanding in programming circles. Never disparage one's choices and do not posture about FP vs. whatever.

If you prefer IRC check out #clojure on libera. If you prefer Slack check out http://clojurians.net

If you didn't get an answer last time, or you'd like more info, feel free to ask again.

5 Comments
2024/11/25
11:01 UTC

16

Indentation-based syntax for Clojure

12 Comments
2024/11/24
12:11 UTC

6

why delay rather than lazy?

5 Comments
2024/11/23
19:37 UTC

12

about babashka pod

What is babashaka pod and do you use it in development or production?

9 Comments
2024/11/23
17:13 UTC

Back To Top