-
Notifications
You must be signed in to change notification settings - Fork 68
Closed
Description
->
and ->>
with one arg could have it's use cases. For ex. mapping "to a structure":
(map #(-> [%]) [1 2 3]) => ([1] [2] [3])
(map #(-> {:foo %}) [1 2 3]) => ({:foo 1} {:foo 2} {:foo 3})
(map #(-> `(~%)) [1 2 3]) => ((1) (2) (3))
which cause "No forms in ->". This has to be written like
(map #(vec [%]) [1 2 3]) ;; i put vec in your ver so you get vec...
(map #(assoc {} :foo %) [1 2 3]) ;; almost like m = {}; for i in ...
(map #(list %) [1 2 3]) ;; ok, this probably is a tie
I assume the linter wants to guard against mistakes like
(let [val ...]
(-> val)
(do-something-with-val)) ;; should be in ->
but I can't think of any examples where this could go unnoticed and not cause problems immediately.
Metadata
Metadata
Assignees
Labels
No labels