Refactor to avoid duplicated code.
This commit is contained in:
parent
5969524bd4
commit
05d9e1a871
|
@ -3,8 +3,8 @@
|
||||||
(require (for-syntax racket/base
|
(require (for-syntax racket/base
|
||||||
;; these requires are needed since their code
|
;; these requires are needed since their code
|
||||||
;; appears in the residual program
|
;; appears in the residual program
|
||||||
"typecheck/renamer.rkt" "types/type-table.rkt")
|
"typecheck/renamer.rkt" "types/type-table.rkt" profile)
|
||||||
"private/base-special-env.rkt")
|
"private/base-special-env.rkt" )
|
||||||
|
|
||||||
(provide (rename-out [module-begin #%module-begin]
|
(provide (rename-out [module-begin #%module-begin]
|
||||||
[top-interaction #%top-interaction]
|
[top-interaction #%top-interaction]
|
||||||
|
@ -21,14 +21,11 @@
|
||||||
((dynamic-require 'typed-scheme/private/base-env 'init))
|
((dynamic-require 'typed-scheme/private/base-env 'init))
|
||||||
((dynamic-require 'typed-scheme/private/base-env-numeric 'init)))
|
((dynamic-require 'typed-scheme/private/base-env-numeric 'init)))
|
||||||
|
|
||||||
(define-syntax (module-begin stx)
|
(define-syntax-rule (drivers [name sym] ...)
|
||||||
|
(begin
|
||||||
|
(define-syntax (name stx)
|
||||||
(do-standard-inits)
|
(do-standard-inits)
|
||||||
((dynamic-require 'typed-scheme/core 'mb-core) stx))
|
((dynamic-require 'typed-scheme/core 'sym) stx))
|
||||||
|
...))
|
||||||
|
|
||||||
(define-syntax (top-interaction stx)
|
(drivers [module-begin mb-core] [top-interaction ti-core] [with-type wt-core])
|
||||||
(do-standard-inits)
|
|
||||||
((dynamic-require 'typed-scheme/core 'ti-core) stx))
|
|
||||||
|
|
||||||
(define-syntax (with-type stx)
|
|
||||||
(do-standard-inits)
|
|
||||||
((dynamic-require 'typed-scheme/core 'wt-core) stx))
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user