Merge pull request #818 from dpk/fix-identifier-syntax

Fix definition of full-match? (Proposed fix for #816)
This commit is contained in:
Alex Shinn 2022-03-17 11:28:54 +09:00 committed by GitHub
commit 1d8bd4abdb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -869,14 +869,11 @@
(define ellipsis (if ellipsis-specified? (cadr expr) (rename '...)))
(define lits (if ellipsis-specified? (car (cddr expr)) (cadr expr)))
(define forms (if ellipsis-specified? (cdr (cddr expr)) (cddr expr)))
(define full-match? (any (lambda (x) (not (pair? (car x)))) forms))
(define (next-symbol s)
(set! count (+ count 1))
(rename (string->symbol (string-append s (%number->string count)))))
(define (expand-pattern pat tmpl)
(define full-match?
(or (not (pair? pat))
(and (compare (car pat) (rename 'set!))
(any (lambda (x) (compare x (rename 'set!))) lits))))
(let lp ((p (if full-match? pat (cdr pat)))
(x (if full-match? _expr (list _cdr _expr)))
(dim 0)