Permalink
Browse files

I've done this

  • Loading branch information...
1 parent 6addc84 commit 926f093b24b1d7fbd5099b32610e43c174622be3 @pangloss pangloss committed Jan 25, 2013
Showing with 5 additions and 1 deletion.
  1. +3 −1 src/kibit/rules/control_structures.clj
  2. +2 −0 test/kibit/test/control_structures.clj
@@ -14,6 +14,8 @@
[(when-not true ?x) _]
[(when false ?x) _]
[(if-let ?binding ?expr nil) (when-let ?binding ?expr)]
+ [(when ?x (do . ?y)) (when ?x . ?y)]
+ [(when-not ?x (do . ?y)) (when-not ?x . ?y)]
;; suggest `while` for bindingless loop-recur
[(loop [] (when ?test . ?exprs (recur)))
@@ -41,4 +43,4 @@
(action d)
(action f))
nil))
-
+
@@ -18,6 +18,8 @@
'_ '(when false anything)
'(when-let [a test] expr) '(if-let [a test] expr nil)
'(let [a 1] (println a) a) '(let [a 1] (do (println a) a))
+ '(when test (println a) then) '(when test (do (println a) then))
+ '(when-not test (println a) then) '(when-not test (do (println a) then))
'(loop [a 4] (println a) (if (zero? a) a (recur (dec a))))
'(loop [a 4] (do (println a) (if (zero? a) a (recur (dec a)))))))

0 comments on commit 926f093

Please sign in to comment.