This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-07-21
Channels
- # announcements (11)
- # architecture (8)
- # aws (7)
- # babashka (1)
- # beginners (55)
- # calva (52)
- # cider (4)
- # clj-kondo (5)
- # clojure (12)
- # clojure-europe (7)
- # clojure-uk (3)
- # clojurescript (40)
- # clr (1)
- # conjure (5)
- # data-oriented-programming (7)
- # datomic (8)
- # emacs (3)
- # events (1)
- # graphql (2)
- # honeysql (5)
- # lsp (7)
- # missionary (24)
- # nbb (10)
- # off-topic (12)
- # pathom (5)
- # reagent (9)
- # reitit (4)
- # schema (1)
- # sci (9)
- # shadow-cljs (2)
- # specter (6)
- # tools-deps (4)
- # xtdb (13)
I wonder if it would be possible to have a linter for this guideline: > Only use pure functions with the lazy sequence operations like map, filter, take-while, etc. When you need side effects, use one of these alternatives: https://stuartsierra.com/2015/08/25/clojure-donts-lazy-effects
I think we could, certainly if you use a side-effecting clojure var directly in map, etc. With composite functions, we need to introduce some side-effect tracking stuff
It seems to me like it would be helpful. Reasoning about how lazy sequence operations get evaluated can get confusing at times, but with this guideline it's pretty clear how to avoid most of the trouble.
I created https://github.com/clj-kondo/clj-kondo/issues/1757 in case there is more interest in this idea.