clojure-uk 2026-07-25

Is there a name for the trailing comma that can be used to improve readability, used in (comment blocks and lists for example....

(comment

  (require '[foo.bar :as baz])

  (baz/do-something-amazing)

  ,)

(prometheus/counter :nuproject/exceptions)
       ;;
       ;; Add more here!
       ;;
       ,)
`

No idea what it's called in that context. With VS Code / Calva, I no longer need to do that: Calva has a special rule for the trailing ) in a comment form.

Okay. Thank you. The reason why I'm asking, is that clj-fmt removes the ,, whereas I want to maintain it

so was looking for a name

@@ -17,7 +17,7 @@
        ;;
        ;; Add more here!
        ;;
-       ,)
+       )
       (ring/initialize)

But it leaves the ) trailing, which I think is the main thing here?

I only used the , to prevent formatters from lifting that trailing ) - I don't like that I needed to do that.

It does leave it, but it, then it gets reformatted incorrectly in my editor

(prometheus/counter :nuproject/exceptions))
       ;;
       ;; Add more here!
       ;;

it pulls the last parens up, leaving the comments dangling and out of place

by having the ,), everything is kept sweet.

so, ideally, I would like clj-fmt, to have a switch, to ignore such things, when formatting.

I see this has been talked about, but no decisions made yet:

I think I'll use this for the time being...

(prometheus/counter :nuproject/exceptions)
       ;;
       ;; Add more here!
       ;;
       #_x)

doesn't cause cljfmt to complain.

Hmm, it works in VS Code/Calva. What editor are you using?

neovim 😉

It's okay, I'm happy to use #_x 🙂

I've seen this cute one 🙂 less likely to be removed by formatters

(comment
  (foo/bar x y z)
  ;;
  ;;
  
  :-)

😃 2