Permalink
Browse files

Made false branch to a-if optional

  • Loading branch information...
1 parent f3f65ec commit c8d685ddeefb6e9acb711193bd39d496eba9b657 @duey-sonian duey-sonian committed May 2, 2011
Showing with 8 additions and 7 deletions.
  1. +8 −7 src/conduit/core.clj
View
@@ -343,13 +343,14 @@
pass-through)
(apply a-select vp-pairs)))
-(defn a-if [a b c]
- (a-comp (a-all (a-arr (comp boolean a))
- pass-through)
- (a-select
- true b
- false c)
- pass-through))
+(defn a-if [a b & [c]]
+ (let [c (or c (constantly nil))]
+ (a-comp (a-all (a-arr (comp boolean a))
+ pass-through)
+ (a-select
+ true b
+ false c)
+ pass-through)))
(defn a-except [p catch-p]
(letfn [(a-except [f catch-f x]

0 comments on commit c8d685d

Please sign in to comment.