Commits

Moritz Heidkamp  committed b01de60

Preserve #f return values of the `then` clause in `if-let*` (thanks Andy Bennett for pointing this out)

  • Participants
  • Parent commits 68e1208

Comments (0)

Files changed (2)

File clojurian-syntax.scm

 (define-syntax if-let*
   (syntax-rules ()
     ((_ ((x y) more ...) then else)
-     (or (and-let* ((x y) more ...)
-           then)
-         else))))
+     (car (or (and-let* ((x y) more ...)
+                (list then))
+              (list else))))))
 
 )

File tests/syntax.scm

   (test 'wrong
         (if-let* ((foo #f) (bar (* foo 2)))
                  (list foo bar)
-                 'wrong)))
+                 'wrong))
+
+  (test #f (if-let (x #t) #f 'wrong))
+  (test #f (if-let* ((x #t)) #f 'wrong)))