mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-10 05:50:26 +02:00
pmatchify a cond for prettiness
* module/language/scheme/translate.scm: pmatchify, it's prettier.
This commit is contained in:
parent
36fb1e06c8
commit
be852e52de
1 changed files with 8 additions and 7 deletions
|
@ -383,8 +383,9 @@
|
||||||
(else (syntax-error (location df) "bad define" df))))
|
(else (syntax-error (location df) "bad define" df))))
|
||||||
;; main
|
;; main
|
||||||
(let loop ((ls body) (ds '()))
|
(let loop ((ls body) (ds '()))
|
||||||
(cond ((null? ls) (syntax-error l "bad body" body))
|
(pmatch ls
|
||||||
((and (pair? (car ls)) (eq? (caar ls) 'define))
|
(() (syntax-error l "bad body" body))
|
||||||
|
(((define . _) . _)
|
||||||
(loop (cdr ls) (cons (car ls) ds)))
|
(loop (cdr ls) (cons (car ls) ds)))
|
||||||
(else
|
(else
|
||||||
(if (null? ds)
|
(if (null? ds)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue