Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

(when-not (empty? x) body) should be (when (seq x) body)

  • Loading branch information...
commit d68221fdcccc8d2a49c3e4158bb4de1a69298dda 1 parent a34d5c4
@miner authored
View
1  src/kibit/rules/collections.clj
@@ -8,6 +8,7 @@
;; empty?
[(not (empty? ?x)) (seq ?x)]
+ [(when-not (empty? ?x) . ?y) (when (seq ?x) . ?y)]
;; set
[(into #{} ?coll) (set ?coll)])
View
2  test/kibit/test/collections.clj
@@ -6,6 +6,8 @@
(are [expected-alt-form test-form]
(= expected-alt-form (:alt (kibit/check-expr test-form)))
'(seq a) '(not (empty? a))
+ '(when (seq a) b) '(when-not (empty? a) b)
+ '(when (seq a) b) '(when (not (empty? a)) b)
'(vector a) '(conj [] a)
'(vector a b) '(conj [] a b)
'(vec coll) '(into [] coll)
Please sign in to comment.
Something went wrong with that request. Please try again.