From: Chris Hanson <org/chris-hanson/cph>
Date: Sat, 20 Jan 2018 04:00:52 +0000 (-0800)
Subject: Fix bug: Can't call output/sequence with an empty list.
X-Git-Tag: mit-scheme-pucked-x11-0.3.1~7^2~336
X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=e6cb1c58992d54d3904ef38a13688be9b471dd7f;p=mit-scheme.git

Fix bug: Can't call output/sequence with an empty list.
---

diff --git a/src/runtime/syntax-compile.scm b/src/runtime/syntax-compile.scm
index b8bb87678..e76cc72b2 100644
--- a/src/runtime/syntax-compile.scm
+++ b/src/runtime/syntax-compile.scm
@@ -52,15 +52,16 @@ USA.
     (if (not (pair? items))
 	(syntax-error "Empty body"))
     (output/sequence
-     (map (lambda (item)
-	    (if (binding-item? item)
-		(let ((value (binding-item/value item)))
-		  (if (keyword-value-item? value)
-		      (output/sequence '())
-		      (output/definition (binding-item/name item)
-					 (compile-item/expression value))))
-		(compile-item/expression item)))
-	  items))))
+     (append-map
+      (lambda (item)
+	(if (binding-item? item)
+	    (let ((value (binding-item/value item)))
+	      (if (keyword-value-item? value)
+		  '()
+		  (list (output/definition (binding-item/name item)
+					   (compile-item/expression value)))))
+	    (list (compile-item/expression item))))
+      items))))
 
 (define (compile-item/expression item)
   (let ((compiler (get-item-compiler item)))
@@ -113,7 +114,4 @@ USA.
   (illegal-expression-compiler "Declaration"))
 
 (define-item-compiler <binding-item>
-  (illegal-expression-compiler "Definition"))
-
-(define-item-compiler <null-binding-item>
   (illegal-expression-compiler "Definition"))
\ No newline at end of file