fix bug that errors when matching vector rule with non-vector expression
This commit is contained in:
parent
b91939f5aa
commit
4f59e07539
|
@ -383,6 +383,7 @@
|
||||||
(define _pair? (r 'pair?))
|
(define _pair? (r 'pair?))
|
||||||
(define _null? (r 'null?))
|
(define _null? (r 'null?))
|
||||||
(define _symbol? (r 'symbol?))
|
(define _symbol? (r 'symbol?))
|
||||||
|
(define _vector? (r 'vector?))
|
||||||
(define _eqv? (r 'eqv?))
|
(define _eqv? (r 'eqv?))
|
||||||
(define _string=? (r 'string=?))
|
(define _string=? (r 'string=?))
|
||||||
(define _map (r 'map))
|
(define _map (r 'map))
|
||||||
|
@ -519,8 +520,10 @@
|
||||||
(lambda (pattern)
|
(lambda (pattern)
|
||||||
(let-values (((match vars) (compile-match-base (vector->list pattern))))
|
(let-values (((match vars) (compile-match-base (vector->list pattern))))
|
||||||
(values
|
(values
|
||||||
`(,_let ((expr (,_vector->list expr)))
|
`(,_if (,_vector? expr)
|
||||||
,match)
|
(,_let ((expr (,_vector->list expr)))
|
||||||
|
,match)
|
||||||
|
(exit #f))
|
||||||
vars)))))
|
vars)))))
|
||||||
|
|
||||||
(let-values (((match vars) (compile-match-base (cdr pattern))))
|
(let-values (((match vars) (compile-match-base (cdr pattern))))
|
||||||
|
|
Loading…
Reference in New Issue