1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-04-30 11:50:28 +02:00

bug#71304: [PATCH] Add support for 'else' clause in R7RS cond-expand.

* module/ice-9/r7rs-libraries.scm (define-library)
<handle-cond-expand>: Add a pattern to match an 'else' clause.

Series-to: bug-guile@gnu.org
This commit is contained in:
Maxim Cournoyer 2024-05-31 23:59:04 -04:00 committed by Arne Babenhauserheide
parent b2cc237a02
commit 522f368719

View file

@ -64,8 +64,10 @@
;; FIXME: R7RS (features) isn't quite the same as ;; FIXME: R7RS (features) isn't quite the same as
;; %cond-expand-features; see scheme/base.scm. ;; %cond-expand-features; see scheme/base.scm.
(memq (syntax->datum #'id) %cond-expand-features)))) (memq (syntax->datum #'id) %cond-expand-features))))
(syntax-case clauses () (syntax-case clauses (else)
(() #'()) ; R7RS says this is not specified :-/ (() #'()) ; R7RS says this is not specified :-/
(((else decl ...))
#'(decl ...))
(((test decl ...) . clauses) (((test decl ...) . clauses)
(if (has-req? #'test) (if (has-req? #'test)
#'(decl ...) #'(decl ...)