mirror of
https://github.com/ashinn/chibi-scheme.git
synced 2025-05-18 21:29:19 +02:00
parent
9fe1e69c23
commit
c28bbbaa98
1 changed files with 1 additions and 4 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Reference in a new issue