From e6cb1c58992d54d3904ef38a13688be9b471dd7f Mon Sep 17 00:00:00 2001 From: Chris Hanson Date: Fri, 19 Jan 2018 20:00:52 -0800 Subject: [PATCH] Fix bug: Can't call output/sequence with an empty list. --- src/runtime/syntax-compile.scm | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) 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 - (illegal-expression-compiler "Definition")) - -(define-item-compiler (illegal-expression-compiler "Definition")) \ No newline at end of file -- 2.25.1