|
|
|
@ -33,7 +33,8 @@
|
|
|
|
;; (pre-post-order $tree `(,(bubble-term rec "key-name")
|
|
|
|
;; (pre-post-order $tree `(,(bubble-term rec "key-name")
|
|
|
|
;; (*default* . ,(lambda x x))))
|
|
|
|
;; (*default* . ,(lambda x x))))
|
|
|
|
;; This will generate a rule which travels in *preorder* to each record named
|
|
|
|
;; 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
|
|
|
|
(define-syntax bubble-term
|
|
|
|
(syntax-rules ()
|
|
|
|
(syntax-rules ()
|
|
|
|
((_ record-sym $str)
|
|
|
|
((_ record-sym $str)
|
|
|
|
@ -42,4 +43,4 @@
|
|
|
|
(let* (($lst (cadr $record)))
|
|
|
|
(let* (($lst (cadr $record)))
|
|
|
|
(receive (head rest)
|
|
|
|
(receive (head rest)
|
|
|
|
(partition (key-contains-defer $str) $lst)
|
|
|
|
(partition (key-contains-defer $str) $lst)
|
|
|
|
(cons head (cons rest '())))))))))
|
|
|
|
(cons head `(',rest)))))))))
|
|
|
|
|