|
|
@ -33,12 +33,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
(define-macro-cases with-pattern
|
|
|
|
(define-macro-cases with-pattern
|
|
|
|
[(_ () . BODY) #'(begin . BODY)]
|
|
|
|
[(_ () . BODY) #'(begin . BODY)]
|
|
|
|
[(_ ([PAT STX] PAT+STX ...) . BODY)
|
|
|
|
[(_ ([PAT0 STX0] PAT+STX ...) . BODY)
|
|
|
|
(with-syntax ([(LITERAL ...) (generate-literals #'PAT)])
|
|
|
|
(with-syntax ([(LITERAL ...) (generate-literals #'PAT0)])
|
|
|
|
#'(syntax-case STX (LITERAL ...)
|
|
|
|
#'(syntax-case STX0 (LITERAL ...)
|
|
|
|
[PAT (with-pattern (PAT+STX ...) (let () . BODY))]))]
|
|
|
|
[PAT0 (with-pattern (PAT+STX ...) (let () . BODY))]
|
|
|
|
[(_ ([ID] STX ...) . BODY) ; standalone id
|
|
|
|
[else (raise-syntax-error 'with-pattern
|
|
|
|
#'(with-pattern ([ID ID] STX ...) . BODY)]) ; convert to previous case
|
|
|
|
(format "unable to match pattern ~a" 'PAT0) STX0)]))])
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(define (check-syntax-list-argument caller-name arg)
|
|
|
|
(define (check-syntax-list-argument caller-name arg)
|
|
|
|