diff --git a/build-aux/bootstrap/birth.scm b/build-aux/bootstrap/birth.scm index 3b2ae07..378d6c0 100644 --- a/build-aux/bootstrap/birth.scm +++ b/build-aux/bootstrap/birth.scm @@ -377,6 +377,10 @@ (("js:console") (string-append "console.log(" (map sexp->es args) ")")) + ;; always expands into nothing; this is just to facilitate its use + ;; moving forward + (("cond-expand") "") + ;; yes, there are more important things to do until we get to the ;; point where it's worth implementing proper tail calls (("js:while") diff --git a/build-aux/bootstrap/rebirth.scm b/build-aux/bootstrap/rebirth.scm index aa4514a..18927de 100644 --- a/build-aux/bootstrap/rebirth.scm +++ b/build-aux/bootstrap/rebirth.scm @@ -398,6 +398,19 @@ (("js:console") (string-append "console.log(" (map sexp->es args) ")")) + ;; very primitive cond-expand + (("cond-expand") + (let* ((clause (car args)) + (feature (token-value (car clause))) + (body (cdr clause))) + (case feature + (("string->es") (body->es body #f)) + (else "")))) + + ;; output raw code into the compiled ECMAScript (what could go wrong?) + (("string->es") + (token-value (car args))) + ;; yes, there are more important things to do until we get to the ;; point where it's worth implementing proper tail calls (("js:while")