birth: Support for cond-expand else
Birth is pretty much at a feature freeze at this point, but `cond-expand' really was difficult to work with in certain circumstances when it didn't even support `else'. * build-aux/bootstrap/birth.scm (fnmap)[cond-expand]: Always expand `else' while dropping all others.master
parent
f18322fbe5
commit
c3dec75fe7
|
@ -378,9 +378,16 @@
|
|||
(("js:console")
|
||||
(string-append "console.log(" (map sexp->es args) ")"))
|
||||
|
||||
;; always expands into nothing; this is just to facilitate its use
|
||||
;; only expands `else' clauses; this is just to facilitate its use
|
||||
;; moving forward
|
||||
(("cond-expand") "")
|
||||
(("cond-expand")
|
||||
(join "" (map (lambda (clause)
|
||||
(let ((feature (token-value (car clause)))
|
||||
(body (cdr clause)))
|
||||
(if (string=? feature "else")
|
||||
(body->es body #f)
|
||||
"")))
|
||||
args)))
|
||||
|
||||
;; yes, there are more important things to do until we get to the
|
||||
;; point where it's worth implementing proper tail calls
|
||||
|
|
Loading…
Reference in New Issue