From 80b0ae61b955b85b76b6680ae546bb26b00f7921 Mon Sep 17 00:00:00 2001 From: Brady McDonough Date: Thu, 4 Feb 2021 14:48:16 -0700 Subject: [PATCH] fixup! fixup! fixup! Added a module for (pre-post-order) utilities --- csv/transform.scm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/csv/transform.scm b/csv/transform.scm index 7a8e519..500fdb0 100644 --- a/csv/transform.scm +++ b/csv/transform.scm @@ -33,7 +33,8 @@ ;; (pre-post-order $tree `(,(bubble-term rec "key-name") ;; (*default* . ,(lambda x x)))) ;; This will generate a rule which travels in *preorder* to each record named -;;'rec' and replace the rec symbol with the pair keyed as "key-name" +;;'rec' and replace the rec symbol with the pair keyed as "key-name". The rest +;;of the record will be a quoted list. (define-syntax bubble-term (syntax-rules () ((_ record-sym $str) @@ -42,4 +43,4 @@ (let* (($lst (cadr $record))) (receive (head rest) (partition (key-contains-defer $str) $lst) - (cons head (cons rest '()))))))))) + (cons head `(',rest)))))))))