Fix w/c to handle expression form of with-contract, and disable internal contracts.

This commit is contained in:
Sam Tobin-Hochstadt 2010-05-13 14:41:59 -04:00
parent 52f5a1936c
commit 684ae395e6

View File

@ -161,7 +161,7 @@ at least theoretically.
;; turn contracts on and off - off by default for performance. ;; turn contracts on and off - off by default for performance.
(define-for-syntax enable-contracts? #t) (define-for-syntax enable-contracts? #f)
(provide (for-syntax enable-contracts?) p/c w/c cnt d-s/c d/c d/c/p) (provide (for-syntax enable-contracts?) p/c w/c cnt d-s/c d/c d/c/p)
(define-syntax-rule (d/c/p (name . args) c . body) (define-syntax-rule (d/c/p (name . args) c . body)
@ -190,6 +190,8 @@ at least theoretically.
(make-rename-transformer #'with-contract) (make-rename-transformer #'with-contract)
(lambda (stx) (lambda (stx)
(syntax-parse stx (syntax-parse stx
[(_ name (~or #:results #:result) spec . body)
#'(let () . body)]
[(_ name specs . body) [(_ name specs . body)
#'(begin . body)])))) #'(begin . body)]))))