You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To upvote this issue, give it a thumbs up. See this list for the most upvoted issues.
I have read the Clojure etiquette and will respect it when communicating on this platform.
Is your feature request related to a problem? Please describe.
I have encountered in multiple projects issues caused by the developer's expectation that the :or in destructuring behaves lazily like an or, meaning it stops evaluating at the first truthy expression. It actually evals the default value regardless:
user> (defnf1 [] (println"WOW YOU DON'T WANT THIS TO RUN"))
#'user/f1
user> (let [{:keys [x] :or {x (f1)}} {:x1}] x)
WOW YOU DON'T WANT THIS TO RUN
1
Describe the solution you'd like
I think clj-kondo should mark the use of s-expressions as default value in the :or mapping of map destructuring forms as an error.
The text was updated successfully, but these errors were encountered:
To upvote this issue, give it a thumbs up. See this list for the most upvoted issues.
Is your feature request related to a problem? Please describe.
I have encountered in multiple projects issues caused by the developer's expectation that the
:or
in destructuring behaves lazily like anor
, meaning it stops evaluating at the first truthy expression. It actually evals the default value regardless:Describe the solution you'd like
I think clj-kondo should mark the use of s-expressions as default value in the :or mapping of map destructuring forms as an error.
The text was updated successfully, but these errors were encountered: