diff --git a/CHANGELOG.md b/CHANGELOG.md index 4407dcd9..1909d54e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ Bug Fixes - Added a fix from Yorick Hardy to define `*ai-v4mapped*` to zero on platforms where `AI_V4MAPPED` is undefined. - Updated `sqrt` to properly handle complex results given non-complex input. EG: `(sqrt -1) ==> 1i`. And updated the parser to properly handle `+i` and `-i`. Thanks to Christopher Hebert for the bug reports! +- Updated `cond-expand` to raise an error if no clauses match, instead of returning `#t`. ## 0.36.0 - February 14, 2024 diff --git a/scheme/base.sld b/scheme/base.sld index 9c147353..93cda120 100644 --- a/scheme/base.sld +++ b/scheme/base.sld @@ -407,7 +407,7 @@ (else (error "cond-expand: bad feature" x))) (memq x (features)))) (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))) ((eq? 'else (caar ls)) ;(identifier->symbol (caar ls))) (if (pair? (cdr ls)) diff --git a/tests/base.scm b/tests/base.scm index c67a23b3..28ff2539 100644 --- a/tests/base.scm +++ b/tests/base.scm @@ -54,6 +54,7 @@ (test "o" (read-line p)) ) ) + (else #f) ) (test-group