>From 8e66ffdaa990f88a3325dc058e2a963a244d8568 Mon Sep 17 00:00:00 2001 From: Evan Hanson Date: Fri, 27 Apr 2018 21:00:41 +0200 Subject: [PATCH] Slightly nicer formatting of generated foreign-lambda* code This puts each string in a foreign-lambda* and foreign-primitive body on its own line (rather than all in one big long line), making it easier to track down errors produced by the C compiler. Closes #1387. Thanks to LemonBoy for the patch. --- core.scm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core.scm b/core.scm index f94e1e64..ac35785f 100644 --- a/core.scm +++ b/core.scm @@ -1834,7 +1834,7 @@ (define (expand-foreign-lambda* exp callback?) (let* ((rtype (second exp)) (args (third exp)) - (body (apply string-append (cdddr exp))) + (body (string-intersperse (cdddr exp) "\n")) (argtypes (map (lambda (x) (car x)) args)) ;; C identifiers aren't hygienically renamed inside body strings (argnames (map cadr (strip-syntax args)))) @@ -1845,7 +1845,7 @@ (let* ((hasrtype (and (pair? (cddr exp)) (not (string? (caddr exp))))) (rtype (if hasrtype (second exp) 'void)) (args (strip-syntax (if hasrtype (third exp) (second exp)))) - (body (apply string-append (if hasrtype (cdddr exp) (cddr exp)))) + (body (string-intersperse (if hasrtype (cdddr exp) (cddr exp)) "\n")) (argtypes (map (lambda (x) (car x)) args)) ;; C identifiers aren't hygienically renamed inside body strings (argnames (map cadr (strip-syntax args)))) -- 2.11.0