Rewrite cond-expand-pattern as cond-expand-clause-pattern.
authorChris Hanson <org/chris-hanson/cph>
Sun, 20 May 2018 00:23:29 +0000 (17:23 -0700)
committerChris Hanson <org/chris-hanson/cph>
Sun, 20 May 2018 00:23:29 +0000 (17:23 -0700)
This will allow it to be reused for define-library.

src/runtime/mit-macros.scm

index 51c789a1631f1913f23f9f6a0cbf2c537473f40a..24dd25d3bdc88c911143f914c7281450b2f5dc08 100644 (file)
@@ -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)