Reduce quantity of requires.
svn: r9665
This commit is contained in:
parent
914de50133
commit
dbc3fa4367
|
@ -1,9 +1,10 @@
|
||||||
#lang s-exp "minimal.ss"
|
#lang s-exp "minimal.ss"
|
||||||
|
|
||||||
(providing (libs (except scheme/base require #%module-begin #%top-interaction with-handlers lambda #%app))
|
(providing (libs (except scheme/base #%module-begin #%top-interaction with-handlers lambda #%app)
|
||||||
|
(except "private/prims.ss"))
|
||||||
(basics #%module-begin
|
(basics #%module-begin
|
||||||
#%top-interaction
|
#%top-interaction
|
||||||
with-handlers
|
|
||||||
lambda
|
lambda
|
||||||
#%app)
|
#%app))
|
||||||
(from scheme require))
|
|
||||||
|
(provide (rename-out [with-handlers: with-handlers]))
|
||||||
|
|
|
@ -1,39 +1,20 @@
|
||||||
#lang scheme/base
|
#lang scheme/base
|
||||||
|
|
||||||
(require (for-template (only-in (lib "list.ss") foldl)
|
;; these are libraries providing functions we add types to that are not in scheme/base
|
||||||
scheme/base
|
|
||||||
'#%paramz
|
|
||||||
scheme/promise
|
|
||||||
string-constants/string-constant
|
|
||||||
#;'#%more-scheme
|
|
||||||
#;'#%qq-and-or
|
|
||||||
(only-in scheme/match/patterns match:error))
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
(require
|
(require
|
||||||
"extra-procs.ss"
|
"extra-procs.ss"
|
||||||
scheme/promise
|
|
||||||
(except-in "type-rep.ss" make-arr)
|
|
||||||
(only-in scheme/list cons? take drop add-between)
|
(only-in scheme/list cons? take drop add-between)
|
||||||
'#%paramz
|
'#%paramz
|
||||||
"type-effect-convenience.ss"
|
(only-in scheme/match/patterns match:error))
|
||||||
(only-in "type-effect-convenience.ss" [make-arr* make-arr])
|
|
||||||
"union.ss"
|
|
||||||
string-constants/string-constant
|
|
||||||
(only-in scheme/match/patterns match:error)
|
|
||||||
"tc-structs.ss")
|
|
||||||
|
|
||||||
|
;; these are all for constructing the types given to variables
|
||||||
(require (for-syntax
|
(require (for-syntax
|
||||||
scheme/base
|
scheme/base
|
||||||
"init-envs.ss"
|
"init-envs.ss"
|
||||||
(except-in "type-rep.ss" make-arr)
|
(except-in "type-rep.ss" make-arr)
|
||||||
(only-in (lib "list.ss") foldl)
|
|
||||||
"type-effect-convenience.ss"
|
"type-effect-convenience.ss"
|
||||||
(only-in "type-effect-convenience.ss" [make-arr* make-arr])
|
(only-in "type-effect-convenience.ss" [make-arr* make-arr])
|
||||||
"union.ss"
|
"union.ss"
|
||||||
string-constants/string-constant
|
|
||||||
(only-in scheme/match/patterns match:error)
|
|
||||||
"tc-structs.ss"))
|
"tc-structs.ss"))
|
||||||
|
|
||||||
(define-for-syntax (initialize-others)
|
(define-for-syntax (initialize-others)
|
||||||
|
@ -415,7 +396,7 @@
|
||||||
[copy-file (-> -Pathlike -Pathlike -Void)]
|
[copy-file (-> -Pathlike -Pathlike -Void)]
|
||||||
[bytes->string/utf-8 (-> -Bytes -String)]
|
[bytes->string/utf-8 (-> -Bytes -String)]
|
||||||
;; language
|
;; language
|
||||||
[(expand #'(this-language))
|
[(expand '(this-language))
|
||||||
Sym
|
Sym
|
||||||
string-constants/string-constant]
|
string-constants/string-constant]
|
||||||
;; make-promise
|
;; make-promise
|
||||||
|
@ -501,8 +482,10 @@
|
||||||
(-> (-Syntax Univ) Univ Univ)))]
|
(-> (-Syntax Univ) Univ Univ)))]
|
||||||
)))
|
)))
|
||||||
|
|
||||||
(begin-for-syntax (initialize-type-env initial-env)
|
(begin-for-syntax
|
||||||
(initialize-others))
|
;(printf "running base-env~n")
|
||||||
|
(initialize-type-env initial-env)
|
||||||
|
(initialize-others))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,40 +1,12 @@
|
||||||
#lang scheme/base
|
#lang scheme/base
|
||||||
|
|
||||||
(require (for-template (only-in (lib "list.ss") foldl)
|
|
||||||
scheme/base
|
|
||||||
'#%paramz
|
|
||||||
scheme/promise
|
|
||||||
string-constants/string-constant
|
|
||||||
#;'#%more-scheme
|
|
||||||
#;'#%qq-and-or
|
|
||||||
(only-in scheme/match/patterns match:error))
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
(require
|
|
||||||
"extra-procs.ss"
|
|
||||||
"init-envs.ss"
|
|
||||||
scheme/promise
|
|
||||||
(except-in "type-rep.ss" make-arr)
|
|
||||||
(only-in scheme/list cons?)
|
|
||||||
"type-effect-convenience.ss"
|
|
||||||
(only-in "type-effect-convenience.ss" [make-arr* make-arr])
|
|
||||||
"union.ss"
|
|
||||||
string-constants/string-constant
|
|
||||||
(only-in scheme/match/patterns match:error)
|
|
||||||
"tc-structs.ss")
|
|
||||||
|
|
||||||
(require (for-syntax
|
(require (for-syntax
|
||||||
scheme/base
|
scheme/base
|
||||||
"init-envs.ss"
|
"init-envs.ss"
|
||||||
(except-in "type-rep.ss" make-arr)
|
(except-in "type-rep.ss" make-arr)
|
||||||
(only-in (lib "list.ss") foldl)
|
|
||||||
"type-effect-convenience.ss"
|
"type-effect-convenience.ss"
|
||||||
(only-in "type-effect-convenience.ss" [make-arr* make-arr])
|
(only-in "type-effect-convenience.ss" [make-arr* make-arr])
|
||||||
"union.ss"
|
"union.ss"))
|
||||||
string-constants/string-constant
|
|
||||||
(only-in scheme/match/patterns match:error)
|
|
||||||
"tc-structs.ss"))
|
|
||||||
|
|
||||||
;; the initial type name environment - just the base types
|
;; the initial type name environment - just the base types
|
||||||
(define-syntax (define-tname-env stx)
|
(define-syntax (define-tname-env stx)
|
||||||
|
@ -49,7 +21,7 @@
|
||||||
(initialize-type-name-env
|
(initialize-type-name-env
|
||||||
(list (list #'nm ty) ...)))
|
(list (list #'nm ty) ...)))
|
||||||
(begin-for-syntax
|
(begin-for-syntax
|
||||||
;(printf "phase is ~a~n" (syntax-local-phase-level))
|
;(printf "running base-types~n")
|
||||||
(initer)))]))
|
(initer)))]))
|
||||||
|
|
||||||
(define-syntax (define-other-types stx)
|
(define-syntax (define-other-types stx)
|
||||||
|
|
|
@ -35,19 +35,11 @@ This file defines two sorts of primitives. All of them are provided into any mod
|
||||||
|
|
||||||
(require "require-contract.ss"
|
(require "require-contract.ss"
|
||||||
"internal-forms.ss"
|
"internal-forms.ss"
|
||||||
"planet-requires.ss"
|
|
||||||
(lib "etc.ss")
|
|
||||||
(except-in (lib "contract.ss") ->)
|
(except-in (lib "contract.ss") ->)
|
||||||
(only-in (lib "contract.ss") [-> c->])
|
(only-in (lib "contract.ss") [-> c->])
|
||||||
(lib "struct.ss")
|
(lib "struct.ss")
|
||||||
"base-types.ss")
|
"base-types.ss")
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
(define-for-syntax (ignore stx) (syntax-property stx 'typechecker:ignore #t))
|
(define-for-syntax (ignore stx) (syntax-property stx 'typechecker:ignore #t))
|
||||||
|
|
||||||
(define-for-syntax (internal stx)
|
(define-for-syntax (internal stx)
|
||||||
|
|
|
@ -21,9 +21,9 @@
|
||||||
"provide-handling.ss"
|
"provide-handling.ss"
|
||||||
"type-alias-env.ss"
|
"type-alias-env.ss"
|
||||||
"type-contract.ss"
|
"type-contract.ss"
|
||||||
(only-in "prims.ss" :)
|
;(only-in "prims.ss" :)
|
||||||
(for-template
|
(for-template
|
||||||
(only-in "prims.ss" :)
|
;(only-in "prims.ss" :)
|
||||||
"internal-forms.ss"
|
"internal-forms.ss"
|
||||||
"tc-utils.ss"
|
"tc-utils.ss"
|
||||||
(lib "contract.ss")
|
(lib "contract.ss")
|
||||||
|
|
|
@ -1,10 +1,6 @@
|
||||||
#lang scheme/base
|
#lang scheme/base
|
||||||
|
|
||||||
(require "private/prims.ss"
|
(require "private/base-env.ss"
|
||||||
"private/init-envs.ss"
|
|
||||||
"private/extra-procs.ss"
|
|
||||||
"private/internal-forms.ss"
|
|
||||||
"private/base-env.ss"
|
|
||||||
"private/base-types.ss"
|
"private/base-types.ss"
|
||||||
(for-syntax
|
(for-syntax
|
||||||
scheme/base
|
scheme/base
|
||||||
|
@ -12,34 +8,22 @@
|
||||||
"private/typechecker.ss"
|
"private/typechecker.ss"
|
||||||
"private/type-rep.ss"
|
"private/type-rep.ss"
|
||||||
"private/provide-handling.ss"
|
"private/provide-handling.ss"
|
||||||
"private/type-environments.ss" "private/tc-utils.ss"
|
"private/type-environments.ss"
|
||||||
"private/type-env.ss" "private/type-name-env.ss"
|
"private/tc-utils.ss"
|
||||||
|
"private/type-name-env.ss"
|
||||||
"private/type-alias-env.ss"
|
"private/type-alias-env.ss"
|
||||||
"private/utils.ss"
|
"private/utils.ss"
|
||||||
"private/internal-forms.ss"
|
|
||||||
"private/init-envs.ss"
|
|
||||||
"private/type-effect-convenience.ss"
|
"private/type-effect-convenience.ss"
|
||||||
"private/effect-rep.ss"
|
|
||||||
"private/rep-utils.ss"
|
|
||||||
"private/type-contract.ss"
|
"private/type-contract.ss"
|
||||||
;(only-in "private/base-types.ss" init-tnames)
|
|
||||||
scheme/nest
|
scheme/nest
|
||||||
syntax/kerncase
|
syntax/kerncase
|
||||||
scheme/match))
|
scheme/match))
|
||||||
|
|
||||||
|
|
||||||
(provide
|
|
||||||
;; provides syntax such as define: and define-typed-struct
|
|
||||||
(all-from-out "private/prims.ss")
|
|
||||||
;; provides some pointless procedures - should be removed
|
|
||||||
(all-from-out "private/extra-procs.ss"))
|
|
||||||
|
|
||||||
(provide-tnames)
|
(provide-tnames)
|
||||||
(provide-extra-tnames)
|
(provide-extra-tnames)
|
||||||
|
|
||||||
|
|
||||||
(provide (rename-out [module-begin #%module-begin]
|
(provide (rename-out [module-begin #%module-begin]
|
||||||
[with-handlers: with-handlers]
|
|
||||||
[top-interaction #%top-interaction]
|
[top-interaction #%top-interaction]
|
||||||
[#%plain-lambda lambda]
|
[#%plain-lambda lambda]
|
||||||
[#%plain-app #%app]
|
[#%plain-app #%app]
|
||||||
|
@ -63,7 +47,7 @@
|
||||||
[with-handlers
|
[with-handlers
|
||||||
([(lambda (e) (and catch-errors? (exn:fail? e) (not (exn:fail:syntax? e))))
|
([(lambda (e) (and catch-errors? (exn:fail? e) (not (exn:fail:syntax? e))))
|
||||||
(lambda (e) (tc-error "Internal error: ~a" e))])]
|
(lambda (e) (tc-error "Internal error: ~a" e))])]
|
||||||
[parameterize ([delay-errors? #f]
|
[parameterize ([delay-errors? #t]
|
||||||
;; this parameter is for parsing types
|
;; this parameter is for parsing types
|
||||||
[current-tvars initial-tvar-env]
|
[current-tvars initial-tvar-env]
|
||||||
;; this parameter is just for printing types
|
;; this parameter is just for printing types
|
||||||
|
|
Loading…
Reference in New Issue
Block a user