racket/collects/typed-scheme/minimal.rkt
2011-06-22 12:40:51 -04:00

29 lines
1023 B
Racket

#lang scheme/base
(provide #%module-begin provide require rename-in rename-out prefix-in only-in all-from-out except-out except-in
providing begin subtract-in)
(require (for-syntax scheme/base) scheme/require)
(define-for-syntax ts-mod 'typed-scheme/typed-scheme)
(define-syntax (providing stx)
(syntax-case stx (libs from basics except)
[(form (libs (except lb ex ...) ...) (basics b ...) (from spec id ...) ...)
(datum->syntax
stx
(syntax->datum
(with-syntax ([(b* ...) (generate-temporaries #'(b ...))]
[ts ts-mod])
(syntax/loc
stx
(begin
(require (except-in ts b ...))
(require (only-in ts [b b*] ...))
(require (except-in lb ex ...) ...)
(require (only-in spec id ...) ...)
(provide id ...) ...
(provide (rename-out [b* b] ...))
(provide (except-out (all-from-out ts) b* ...))
(provide (all-from-out lb) ...))))))]))