Revert "refine define"

This reverts commit 328f38a128.
pull/2/head
Matthew Butterick 11 years ago
parent 328f38a128
commit 2d0a59985c

@ -1,24 +1,8 @@
#lang racket/base #lang racket/base
(require (for-syntax racket/base)) (require (for-syntax racket/base))
(provide (all-defined-out))
;; this macro requires that the source file also contain
;; (module+ safe
;; (require racket/contract))
(define-syntax (define+provide+safe stx)
(syntax-case stx ()
[(_ (proc arg ... . rest-arg) contract body ...)
#'(define+provide+safe proc contract
(λ(arg ... . rest-arg) body ...))]
[(_ name contract body ...)
#'(begin
(define name body ...)
(provide name)
(module+ safe
(require racket/contract) (require racket/contract)
(provide (contract-out [name contract]))))]))
(provide define+provide define+provide/contract define/contract+provide)
;; each define macro recursively converts any form of define ;; each define macro recursively converts any form of define
;; into its lambda form (define name body ...) and then operates on that. ;; into its lambda form (define name body ...) and then operates on that.

Loading…
Cancel
Save