From 9c0a2820615bf36e02eeebe2f94d7753f8f0a8d0 Mon Sep 17 00:00:00 2001 From: Chris Hanson Date: Sat, 19 May 2018 17:23:29 -0700 Subject: [PATCH] Rewrite cond-expand-pattern as cond-expand-clause-pattern. This will allow it to be reused for define-library. --- src/runtime/mit-macros.scm | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/runtime/mit-macros.scm b/src/runtime/mit-macros.scm index 51c789a16..24dd25d3b 100644 --- a/src/runtime/mit-macros.scm +++ b/src/runtime/mit-macros.scm @@ -615,9 +615,12 @@ USA. (define $cond-expand (spar-transformer->runtime - (delay (scons-rule (cond-expand-pattern) generate-cond-expand)))) + (delay + (scons-rule `((value id=?) + (+ ,(cond-expand-clause-pattern))) + generate-cond-expand)))) -(define (cond-expand-pattern) +(define (cond-expand-clause-pattern) (define clause-pattern (let ((clause-pattern* (lambda args (apply clause-pattern args)))) (spar-or @@ -634,9 +637,8 @@ USA. (spar-and (spar-push-subform-if spar-arg:id=? 'not) clause-pattern* (spar-match-null)))))))) - `((value id=?) - (+ (subform (cons (spar ,clause-pattern) - (* any)))))) + `(subform (cons (spar ,clause-pattern) + (* any)))) (define (generate-cond-expand id=? clauses) -- 2.25.1