improve error msgs in macro

pull/17/head
Matthew Butterick 9 years ago
parent 5e283216a6
commit cd1ee2ce21

@ -16,8 +16,8 @@
;; convert calling pattern to form (id contract body-exp) ;; convert calling pattern to form (id contract body-exp)
(define-syntax-rule (lambdafy-with-contract stx) (define-syntax-rule (lambdafy-with-contract stx)
(syntax-case stx () (syntax-case stx ()
[(_ (id arg (... ...) . rest-arg) contract body (... ...)) [(_ (id arg (... ...) . rest-arg) contract body0 body (... ...))
(replace-context #'id #'(id contract (λ (arg (... ...) . rest-arg) body (... ...))))] (replace-context #'id #'(id contract (λ (arg (... ...) . rest-arg) body0 body (... ...))))]
[(_ id contract lambda-exp) [(_ id contract lambda-exp)
(replace-context #'id #'(id contract lambda-exp))])) (replace-context #'id #'(id contract lambda-exp))]))
@ -25,7 +25,7 @@
;; convert calling pattern to form (id body-exp) ;; convert calling pattern to form (id body-exp)
(define-syntax-rule (lambdafy stx) (define-syntax-rule (lambdafy stx)
(syntax-case stx () (syntax-case stx ()
[(_ (id arg (... ...) . rest-arg) body (... ...)) [(_ (id arg (... ...) . rest-arg) body0 body (... ...))
(replace-context #'id #'(id (λ (arg (... ...) . rest-arg) body (... ...))))] (replace-context #'id #'(id (λ (arg (... ...) . rest-arg) body0 body (... ...))))]
[(_ id lambda-exp) [(_ id lambda-exp)
(replace-context #'id #'(id lambda-exp))])) (replace-context #'id #'(id lambda-exp))]))
Loading…
Cancel
Save