Per R7RS, cond-expand doesn't signal an error when there are no matching clauses.

You can still use syntax-error to explicitly signal an error.
This commit is contained in:
Alex Shinn 2011-12-17 15:54:35 +09:00
parent 348b176172
commit 620eba1169

View file

@ -563,7 +563,7 @@
(else (error "cond-expand: bad feature" x))) (else (error "cond-expand: bad feature" x)))
(memq (identifier->symbol x) *features*))) (memq (identifier->symbol x) *features*)))
(let expand ((ls (cdr expr))) (let expand ((ls (cdr expr)))
(cond ((null? ls) (error "cond-expand: no expansions" expr)) (cond ((null? ls)) ; (error "cond-expand: no expansions" expr)
((not (pair? (car ls))) (error "cond-expand: bad clause" (car ls))) ((not (pair? (car ls))) (error "cond-expand: bad clause" (car ls)))
((eq? 'else (identifier->symbol (caar ls))) ((eq? 'else (identifier->symbol (caar ls)))
(if (pair? (cdr ls)) (if (pair? (cdr ls))