Ticket #1020: arrows-and-questionmarks.diff
File arrows-and-questionmarks.diff, 1.7 KB (added by , 10 years ago) |
---|
-
matchable.scm
125 125 ;; pattern so far. 126 126 127 127 (define-syntax match-two 128 (syntax-rules (_ ___ ..1 *** quote quasiquote ? $ = and or not set! get!)128 (syntax-rules (_ ___ ..1 *** quote quasiquote ? -> -?> $ = and or not set! get!) 129 129 ((match-two v () g+s (sk ...) fk i) 130 130 (if (null? v) (sk ... i) fk)) 131 131 ((match-two v (quote p) g+s (sk ...) fk i) … … 148 148 (let ((setter (lambda (x) (s ... x)))) (sk ... i))) 149 149 ((match-two v (? pred . p) g+s sk fk i) 150 150 (if (pred v) (match-one v (and . p) g+s sk fk i) fk)) 151 ((match-two v (-> convert . p) g+s sk fk i) 152 (let ((w (convert v))) (match-one w (and . p) g+s sk fk i))) 153 ((match-two v (-?> convert . p) g+s sk fk i) 154 (match-two v (-> convert (? (lambda (x) x) . p)) g+s sk fk i)) 151 155 ((match-two v (= proc p) . x) 152 156 (let ((w (proc v))) (match-one w p . x))) 153 157 ((match-two v (p ___ . r) g+s sk fk i) … … 515 519 ;; (match-extract-vars pattern continuation (ids ...) (new-vars ...)) 516 520 517 521 (define-syntax match-extract-vars 518 (syntax-rules (_ ___ ..1 *** ? $ = quote quasiquote and or not get! set!)522 (syntax-rules (_ ___ ..1 *** ? -> -?> $ = quote quasiquote and or not get! set!) 519 523 ((match-extract-vars (? pred . p) . x) 520 524 (match-extract-vars p . x)) 525 ((match-extract-vars (-> convert . p) . x) 526 (match-extract-vars p . x)) 527 ((match-extract-vars (-?> convert . p) . x) 528 (match-extract-vars p . x)) 521 529 ((match-extract-vars ($ rec . p) . x) 522 530 (match-extract-vars p . x)) 523 531 ((match-extract-vars (= proc p) . x)