(r-null? (close-syntax 'NULL? environment))
(r-pair? (close-syntax 'PAIR? environment))
(r-quote (close-syntax 'QUOTE environment)))
- (let descend ((pattern pattern)
+ (let descend ((top-level #t)
+ (pattern pattern)
(body `(,body ,@(pattern-variables pattern))))
(if (pair? pattern)
(if (eq? (car pattern) pattern-variable-tag)
`(,r-lambda (,(cdr pattern)) ,body)
(let ((instance (generate-uninterned-symbol)))
`(,r-lambda (,instance)
+ ,@(if top-level `((,r-declare (NO-TYPE-CHECKS))) '())
(,r-and (,r-pair? ,instance)
- (,(descend (car pattern)
- `(,(descend (cdr pattern) body)
- (,r-cdr ,instance)))
+ (,(descend #f (car pattern)
+ `(,(descend #f (cdr pattern) body)
+ (,r-cdr ,instance)))
(,r-car ,instance))))))
(let ((instance (generate-uninterned-symbol)))
`(,r-lambda (,instance)
environment)
environment))))
-(define compile-pattern-matchers? #f)
+(define compile-pattern-matchers? #t)
(define (make-rule-matcher pattern expression environment)
;; PATTERN-LOOKUP-2 and the compiled matchers require that there
,@qualifiers
(,r-lambda () ,body)))))
`(,r-lambda ,outer-vars
- (,(close-syntax 'DECLARE environment) (INTEGRATE ,@outer-vars))
+ (,(close-syntax 'DECLARE environment)
+ (INTEGRATE ,@outer-vars)
+ (TYPE-CHECKS))
,(if (and (null? inner-vars)
(null? xforms))
qualified-body