Fix bug: Can't call output/sequence with an empty list.
authorChris Hanson <org/chris-hanson/cph>
Sat, 20 Jan 2018 04:00:52 +0000 (20:00 -0800)
committerChris Hanson <org/chris-hanson/cph>
Sat, 20 Jan 2018 04:00:52 +0000 (20:00 -0800)
src/runtime/syntax-compile.scm

index b8bb876781386ebdd2ca0342ce858f43d3474b22..e76cc72b254a68e1e684a38855923a098bc6f2ef 100644 (file)
@@ -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