This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-09-24
Channels
- # announcements (7)
- # babashka (5)
- # babashka-sci-dev (20)
- # beginners (125)
- # biff (98)
- # catalyst (1)
- # clerk (37)
- # clj-kondo (6)
- # clojure (49)
- # clojure-dev (18)
- # clojure-europe (6)
- # clojure-uk (2)
- # data-science (17)
- # deps-new (20)
- # emacs (11)
- # helix (5)
- # hyperfiddle (34)
- # malli (3)
- # missionary (4)
- # reitit (4)
- # sci (15)
- # solo-full-stack (7)
- # sql (5)
- # testing (2)
I’m seeing a warning on some code that mutates in place and returns the value after. I can just ignore it, just wanted to ask if this is expected and wanted.
clj-kondo --lint - <<< "(let [res (transient [])] (conj! res 1) res)"
<stdin>:1:27: warning: Unused value
linting took 22ms, errors: 0, warnings: 1
yes, this is a very desirable warning since transient operation results should be used, if not, weird things can happen since a transient op can return a different object than you had originally
you can read more in this reddit post + comments: https://www.reddit.com/r/Clojure/comments/muqetg/transient_set_loses_data/