Implemented issue #90 (if ?x ?x ?y) -> (or ?x ?y)

This commit is contained in:
TAllen 2014-04-04 01:45:25 -07:00
parent 821698651d
commit 16c230d5df
2 changed files with 2 additions and 0 deletions

View file

@ -6,6 +6,7 @@
[(if ?x nil ?y) (when-not ?x ?y)]
[(if ?x (do . ?y)) (when ?x . ?y)]
[(if (not ?x) ?y ?z) (if-not ?x ?y ?z)]
[(if ?x ?x ?y) (or ?x ?y)]
[(when (not ?x) . ?y) (when-not ?x . ?y)]
[(do ?x) ?x]
[(if-let ?binding ?expr nil) (when-let ?binding ?expr)]

View file

@ -9,6 +9,7 @@
'(when-not test else) '(if test nil else)
'(when test body) '(if test (do body))
'(if-not test then else) '(if (not test) then else)
'(or test else) '(if test test else)
'(when-not test then) '(when (not test) then)
'single-expression '(do single-expression)
'(when-let [a test] expr) '(if-let [a test] expr nil)