From 5e2e4a51f93f98c35824e4a7f5a88274d1551b4c Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Sun, 1 Jan 2017 22:22:14 +0100 Subject: gexp: Support 'ungexp' forms in improper lists. * guix/gexp.scm (gexp)[collect-escapes, substitute-references]: Replace the (exp0 exp ...) patterns with (exp0 . exp) to match improper lists. Adjust clause bodies accordingly. * tests/gexp.scm ("one input package, dotted list"): New test. --- guix/gexp.scm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'guix') diff --git a/guix/gexp.scm b/guix/gexp.scm index 79a7b18b09..1f7fbef0a0 100644 --- a/guix/gexp.scm +++ b/guix/gexp.scm @@ -812,9 +812,9 @@ (define (collect-escapes exp) (cons exp result)) ((ungexp-native-splicing _ ...) (cons exp result)) - ((exp0 exp ...) + ((exp0 . exp) (let ((result (loop #'exp0 result))) - (fold loop result #'(exp ...)))) + (loop #'exp result))) (_ result)))) @@ -875,9 +875,9 @@ (define (substitute-references exp substs) (substitute-ungexp-splicing exp substs)) (((ungexp-native-splicing _ ...) rest ...) (substitute-ungexp-splicing exp substs)) - ((exp0 exp ...) + ((exp0 . exp) #`(cons #,(substitute-references #'exp0 substs) - #,(substitute-references #'(exp ...) substs))) + #,(substitute-references #'exp substs))) (x #''x))) (syntax-case s (ungexp output) -- cgit v1.2.3