From c1152ba0a63f27faba564254fbd597b34d1d34d9 Mon Sep 17 00:00:00 2001 From: Leandro Facchinetti Date: Fri, 14 Oct 2016 22:00:04 -0400 Subject: [PATCH] Fix `when/splice' inconsistent return types MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit **CURRENT BEHAVIOR** The function `when/splice` returns either a list (when the condition is true), or a string (when the condition is false). This makes it unusable in contexts that expect lists—for example, `(... ,@◊when/splice[...]{...} ...)`. **EXPECTED BEHAVIOR** The return types of `when/splice` are consistent. When the condition is false, return an empty list. --- pollen/core.rkt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pollen/core.rkt b/pollen/core.rkt index cc04e7d..cdeb1c8 100644 --- a/pollen/core.rkt +++ b/pollen/core.rkt @@ -121,7 +121,7 @@ #'(if COND (with-handlers ([exn:fail? (λ(exn) (error (format "within when/splice, ~a" (exn-message exn))))]) (SPLICING-TAG BODY ...)) - ""))])) + '()))])) (provide when/block) ; bw compat -- 2.25.1