1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-12 06:41:13 +02:00

Make `cond-expand' compilable.

* module/ice-9/boot-9.scm (cond-expand): Changed into a `define-macro'
  macro.
This commit is contained in:
Ludovic Courtès 2009-06-19 22:46:07 +02:00
parent 23044464c2
commit f4bf64b4d4

View file

@ -3192,11 +3192,8 @@ module '(ice-9 q) '(make-q q-length))}."
(append (hashq-ref %cond-expand-table mod '())
features)))))
(define cond-expand
(procedure->memoizing-macro
(lambda (exp env)
(let ((clauses (cdr exp))
(syntax-error (lambda (cl)
(define-macro (cond-expand . clauses)
(let ((syntax-error (lambda (cl)
(error "invalid clause in `cond-expand'" cl))))
(letrec
((test-clause
@ -3204,7 +3201,7 @@ module '(ice-9 q) '(make-q q-length))}."
(cond
((symbol? clause)
(or (memq clause %cond-expand-features)
(let lp ((uses (module-uses (env-module env))))
(let lp ((uses (module-uses (current-module))))
(if (pair? uses)
(or (memq clause
(hashq-ref %cond-expand-table
@ -3254,7 +3251,7 @@ module '(ice-9 q) '(make-q q-length))}."
(syntax-error c))
`(begin ,@(cdar c)))
(else
(lp (cdr c))))))))))
(lp (cdr c))))))))
;; This procedure gets called from the startup code with a list of
;; numbers, which are the numbers of the SRFIs to be loaded on startup.