Fixed issues caused by splitting library.

This commit is contained in:
Georges Dupéron 2016-03-02 20:21:36 +01:00
parent a91cc950cd
commit eb0942a816
33 changed files with 111 additions and 113 deletions

View File

@ -201,15 +201,11 @@ Library functions and utilities
Utilities that complement racket and typed/racket's standard libraries.
* `lib/low.rkt`
* `lib/low.rkt` and `lib/low/*.rkt`
Lower-level utilities that complement racket and typed/racket's standard
libraries.
* `lib/low-untyped.rkt`
Wrapper around `lib/low.rkt` that allows using it from a untyped racket file.
* `lib/untyped/for-star-list-star.rkt`
A utility macro similar to `for*/list` to iterate over collections and return
@ -218,7 +214,8 @@ Library functions and utilities
* `lib/untyped.rkt`
Aggregates `lib/low-untyped.rkt`, and `lib/untyped/for-star-list-star.rkt`.
Aggregates `(submod "lib/low.rkt" untyped)`, and
`lib/untyped/for-star-list-star.rkt`.
* `lib/test-framework.rkt`

View File

@ -11,16 +11,15 @@
(require "get.lp2.rkt"
"../lib/low-untyped.rkt"
(submod "../lib/low.rkt" untyped)
(for-syntax racket/string
syntax/parse
racket/syntax
syntax/stx
syntax/strip-context
racket/struct
racket/function
syntax/srcloc
"../lib/low-untyped.rkt"))
(submod "../lib/low.rkt" untyped)))
#|
(define-syntax/parse (dot x:id)

View File

@ -226,7 +226,7 @@ position in the vector equal to the index associated to it in the hash table:
(require (for-syntax syntax/parse
syntax/parse/experimental/template
racket/syntax
"../lib/low-untyped.rkt")
(submod "../lib/low.rkt" untyped))
"../lib/low.rkt"
"../type-expander/type-expander.lp2.rkt")

View File

@ -201,7 +201,7 @@ The type for the function generated by @tc[λget] mirrors the cases from
(module main typed/racket
(require (for-syntax syntax/parse
racket/syntax
"../lib/low-untyped.rkt")
(submod "../lib/low.rkt" untyped))
"../lib/low.rkt"
"structure.lp2.rkt"
"variant.lp2.rkt"

View File

@ -150,9 +150,7 @@ name) with the right type, so that the user doesn't see all the types in the
(require (for-syntax syntax/parse
syntax/parse/experimental/template
racket/syntax
syntax/stx
"../lib/low-untyped.rkt"
"../lib/low/multiassoc-syntax.rkt")
(submod "../lib/low.rkt" untyped))
"../lib/low.rkt"
"graph.lp2.rkt"
"get.lp2.rkt"

View File

@ -162,11 +162,8 @@ encapsulating the result types of mappings.
(require (for-syntax syntax/parse
syntax/parse/experimental/template
racket/syntax
syntax/stx
"../lib/low-untyped.rkt"
"../lib/low/multiassoc-syntax.rkt"
"rewrite-type.lp2.rkt"; debug
)
(submod "../lib/low.rkt" untyped)
"rewrite-type.lp2.rkt" #|debug|#)
(rename-in "../lib/low.rkt" [~> threading:~>])
"graph.lp2.rkt"
"get.lp2.rkt"

View File

@ -761,12 +761,11 @@ We will be able to use this type expander in function types, for example:
(module main typed/racket
(require (for-syntax syntax/parse
racket/syntax
syntax/stx
syntax/parse/experimental/template
racket/sequence
racket/pretty
"rewrite-type.lp2.rkt"
"../lib/low-untyped.rkt"
(submod "../lib/low.rkt" untyped)
"meta-struct.rkt")
racket/splicing
"fold-queues.lp2.rkt"

View File

@ -840,9 +840,8 @@ checker, unless it is absorbed by a larger type, like in
syntax/parse/experimental/template
racket/syntax
racket/function
syntax/stx
racket/pretty
"../lib/low-untyped.rkt"
(submod "../lib/low.rkt" untyped)
"../lib/untyped.rkt")
(prefix-in DEBUG-tr: typed/racket)
syntax/parse

View File

@ -2,9 +2,8 @@
(require (for-syntax racket/syntax
racket/function
syntax/stx
syntax/parse
"../lib/low-untyped.rkt")
(submod "../lib/low.rkt" untyped))
"../lib/low.rkt"
"get.lp2.rkt"
"../type-expander/type-expander.lp2.rkt")

View File

@ -1,7 +1,7 @@
#lang typed/racket
(require (for-syntax syntax/parse
"../lib/low-untyped.rkt")
(submod "../lib/low.rkt" untyped))
"../type-expander/type-expander.lp2.rkt")
(provide curry-map)

View File

@ -1,10 +1,9 @@
#lang typed/racket
(require (for-syntax racket/syntax
syntax/stx
syntax/parse
syntax/parse/experimental/template
"../lib/low-untyped.rkt")
(submod "../lib/low.rkt" untyped))
"../lib/low.rkt"
"get.lp2.rkt"
"../type-expander/type-expander.lp2.rkt")

View File

@ -1,10 +1,9 @@
#lang debug typed/racket
(require (for-syntax racket/syntax
syntax/stx
syntax/parse
syntax/parse/experimental/template
"../lib/low-untyped.rkt")
(submod "../lib/low.rkt" untyped))
(for-meta 2
racket/base
racket/syntax)

View File

@ -375,7 +375,7 @@ was a tag requested.
(module main typed/racket
(require (for-syntax syntax/parse
racket/syntax
"../lib/low-untyped.rkt")
(submod "../lib/low.rkt" untyped))
"../lib/low.rkt"
racket/set
racket/format)

View File

@ -630,11 +630,10 @@ These metafunctions just extract the arguments for @tc[replace-in-type] and
(require
(for-syntax syntax/parse
racket/syntax
syntax/stx
racket/format
syntax/parse/experimental/template
racket/sequence
"../lib/low-untyped.rkt"
(submod "../lib/low.rkt" untyped)
(only-in "../type-expander/type-expander.lp2.rkt"
expand-type)
"meta-struct.rkt")

View File

@ -591,12 +591,10 @@ chances that we could write a definition for that identifier.
syntax/parse/experimental/template
mzlib/etc
racket/struct-info
syntax/stx
racket/sequence
;; in-syntax on older versions:
;;;unstable/sequence
"../lib/low-untyped.rkt"
"../lib/low/multiassoc-syntax.rkt"
(submod "../lib/low.rkt" untyped)
"meta-struct.rkt")
"../lib/low.rkt"
"../type-expander/type-expander.lp2.rkt"

View File

@ -281,7 +281,7 @@ number of name collisions.
(require (for-syntax syntax/parse
syntax/parse/experimental/template
racket/syntax
"../lib/low-untyped.rkt")
(submod "../lib/low.rkt" untyped))
"../lib/low.rkt"
"../type-expander/multi-id.lp2.rkt"
"../type-expander/type-expander.lp2.rkt"

View File

@ -10,7 +10,7 @@
(require scriblib/render-cond)
;(require "low-untyped.rkt")
;(require "(submod low.rkt untyped)")
;(#lang reader "scribble-custom/lp2.rkt" #:lang typed/racket)
;; http://lists.racket-lang.org/users/archive/2015-January/065752.html

View File

@ -50,8 +50,8 @@ scribble, see
(module main typed/racket
(require (for-syntax syntax/parse
racket/syntax
"../../lib/low-untyped.rkt")
"../../lib/low-untyped.rkt")
(submod "../../lib/low.rkt" untyped))
(submod "../../lib/low.rkt" untyped))
(provide foo)
<foo>

View File

@ -1,30 +1,31 @@
#lang typed/racket
(require "low2/typed-untyped.rkt")
(require "low/typed-untyped.rkt")
(define-typed/untyped-modules #:no-test
(require "low2/typed-untyped.rkt")
(provide (all-from-out "low2/typed-untyped.rkt"))
(require "low/typed-untyped.rkt")
(provide (all-from-out "low/typed-untyped.rkt"))
;(require/provide (typed/untyped "low2/fixnum.rkt" …))
;(require/provide (typed/untyped "low/fixnum.rkt" …))
(require/provide-typed/untyped
"low2/fixnum.rkt"
"low2/typed-rackunit.rkt"
"low2/typed-rackunit-extensions.rkt"
"low2/syntax-parse.rkt"
"low2/threading.rkt"
"low2/aliases.rkt"
"low2/sequence.rkt"
"low2/repeat-stx.rkt"
"low2/stx.rkt"
"low2/list.rkt"
"low2/ids.rkt"
"low2/generate-indices.rkt"
"low2/set.rkt"
"low2/type-inference-helpers.rkt"
"low2/percent.rkt"
"low2/not-implemented-yet.rkt"
"low2/cond-let.rkt"
"low/misc.rkt"
"low/require-provide.rkt"
"low/fixnum.rkt"
"low/typed-rackunit.rkt"
"low/typed-rackunit-extensions.rkt"
"low/syntax-parse.rkt"
"low/threading.rkt"
"low/aliases.rkt"
"low/sequence.rkt"
"low/repeat-stx.rkt"
"low/stx.rkt"
"low/list.rkt"
"low/values.rkt"
"low/ids.rkt"
"low/generate-indices.rkt"
"low/set.rkt"
"low/type-inference-helpers.rkt"
"low/percent.rkt"
"low/not-implemented-yet.rkt"
"low/cond-let.rkt"
"low/multiassoc-syntax.rkt"
"low/tmpl-multiassoc-syntax.rkt"
"low/logn-id.rkt"))
(require 'typed)

View File

@ -1,7 +1,16 @@
#lang typed/racket
(require "typed-untyped.rkt")
(define-typed/untyped-modules #:no-test
(provide …+)
(provide (all-from-out racket/match)
…+
match-λ
match-λ*
match-λ**
generate-temporary)
(require racket/match)
(require (only-in racket
[compose ]
@ -9,10 +18,9 @@
(only-in syntax/parse
[...+ …+]))
(require racket/match)
(provide (all-from-out racket/match)
(rename-out [match-lambda match-λ]
[match-lambda* match-λ*]
[match-lambda** match-λ**]))
(require (only-in racket/match
[match-lambda match-λ]
[match-lambda* match-λ*]
[match-lambda** match-λ**]))
(require/typed racket/syntax [generate-temporary ( Any Identifier)]))

View File

@ -10,9 +10,10 @@
define-temp-ids)
(require "typed-untyped.rkt")
(require-typed/untyped "sequence.rkt")
(require-typed/untyped "sequence.rkt"
"aliases.rkt")
(begin-for-syntax (require "typed-untyped.rkt")
(require-typed/untyped "aliases.rkt"))
(module m-!temp racket
(provide !temp)
@ -34,8 +35,7 @@
(require/typed racket/syntax
[format-id ( Syntax String (U String Identifier) *
Identifier)]
[(generate-temporary generate-temporary2) ( Any Identifier)])
Identifier)])
(require (only-in racket/syntax define/with-syntax)
(only-in syntax/stx stx-map)
(for-syntax racket/base
@ -293,7 +293,7 @@
#'(let1 d1 (let ((foo-b 2) (foo-c 'b)) (cons foo-x foo-y))))]))
(check-equal?: (test1 (let ((foo-b 1) (foo-c 'a))) b c)
'(1 . b))
'(1 . b))
(define-syntax (fubar stx)
(define/with-syntax (v1 ...) #'(1 2 3))

View File

@ -1,13 +1,14 @@
#lang typed/racket
(require "../low2/typed-untyped.rkt")
(require "typed-untyped.rkt")
(define-typed/untyped-modules #:no-test
(provide define-logn-ids)
(require (for-syntax syntax/parse
racket/syntax
racket/function
racket/match
syntax/stx))
(provide define-logn-ids)
syntax/stx)
"typed-untyped.rkt")
(begin-for-syntax
(define (insert make-node v ts)
@ -53,7 +54,8 @@
(define (make-btd bt)
(match bt
[`(node ,s ,(and a `(,_ ,sa . ,_)) ,b)
#`(if ((make-predicate #,sa) v-cache)
#`(if (if-typed ((make-predicate #,sa) v-cache)
#,(format-id sa "~a?" sa))
#,(make-btd a)
#,(make-btd b))]
[`(leaf ,s ,a ,t ,tmp)

View File

@ -1,6 +1,6 @@
#lang typed/racket
(require "typed-untyped.rkt")
(define-typed/untyped-modules
(define-typed/untyped-modules #:no-test
(provide hash-set**
;string-set!
;string-copy!

View File

@ -1,9 +0,0 @@
#lang racket
(begin-for-syntax
(define partially-defined-module++ (make-hash
(define-syntax (module++ stx)
(syntax-case stx
[(_ name lang . body)
(syntax-local-lift-module-end-declaration #'define-module )

View File

@ -1,13 +1,13 @@
#lang typed/racket
(require "../low2/typed-untyped.rkt")
(require "typed-untyped.rkt")
(define-typed/untyped-modules #:no-test
(provide multiassoc-syntax
cdr-assoc-syntax
assoc-syntax)
(require "../low2/typed-untyped.rkt")
(require-typed/untyped "../low2/aliases.rkt"
"../low2/stx.rkt")
(require "typed-untyped.rkt")
(require-typed/untyped "aliases.rkt"
"stx.rkt")
;; TODO: cdr-stx-assoc is already defined in lib/low.rkt

View File

@ -31,11 +31,14 @@
check-duplicate-identifiers
nameof)
nameof
(all-from-out syntax/stx))
(require "typed-untyped.rkt")
(require-typed/untyped "sequence.rkt")
(require syntax/stx)
;; match-expanders:
;; stx-list
;; stx-e
@ -150,14 +153,26 @@
(: stx-null? ( Any Boolean : (U (Syntaxof Null) Null)))
(define (stx-null? v)
((make-predicate (U (Syntaxof Null) Null)) v))
(if-typed
((make-predicate (U (Syntaxof Null) Null)) v)
(or (null? v) (and (syntax? v) (null? (syntax-e v))))))
(module+ test
(check-equal? (stx-null? #f) #f)
(check-equal? (stx-null? 'a) #f)
(check-equal? (stx-null? '()) #t)
(check-equal? (stx-null? #'()) #t)
(check-equal? (stx-null? #''()) #f)
(check-equal? (stx-null? #'a) #f))
(: stx-pair? ( Any Boolean : (U (Pairof Any Any)
(Syntaxof (Pairof Any Any)))))
(define (stx-pair? v)
((make-predicate (U (Pairof Any Any)
(Syntaxof (Pairof Any Any))))
v)))
(if-typed
((make-predicate (U (Pairof Any Any)
(Syntaxof (Pairof Any Any))))
v)
(or (pair? v) (and (syntax? v) (pair? (syntax-e v)))))))
;; constructors:
;; stx-cons
@ -267,7 +282,7 @@
[else
(stx-drop-last (syntax-e l))])
#;(if ((make-predicate (Syntaxof Any)) l)
#;(if (if-typed ((make-predicate (Syntaxof Any)) l) (syntax? l))
(stx-drop-last (syntax-e l))
(if (null? l)
#'()

View File

@ -1,18 +1,17 @@
#lang typed/racket
(require "../low2/typed-untyped.rkt")
(require "typed-untyped.rkt")
(define-typed/untyped-modules #:no-test
(provide tmpl-cdr-assoc-syntax
(rename-out [tmpl-cdr-assoc-syntax !cdr-assoc]))
(require "../low2/typed-untyped.rkt")
(module m-tmpl-cdr-assoc-syntax racket
(provide tmpl-cdr-assoc-syntax)
(require syntax/parse
syntax/parse/experimental/template
(submod "../low2/stx.rkt" untyped)
(submod "multiassoc-syntax.rkt" untyped))
(submod "stx.rkt" untyped)
(submod "multiassoc-syntax.rkt" untyped)
(submod "aliases.rkt" untyped))
(define-template-metafunction (tmpl-cdr-assoc-syntax stx)
(syntax-parse stx

View File

@ -1,5 +1,5 @@
#lang racket
(require "low-untyped.rkt")
(require (submod "low.rkt" untyped))
(with-syntax ([((foo ...) ...) #'((aa bb cc) (x1 x2))])
(define-temp-ids "___~a.truc" ((foo ...) ...) #:first-base fst)

View File

@ -1,4 +1,4 @@
#lang typed/racket
(require "low-untyped.rkt")
(require "low.rkt")
(require/provide "untyped/for-star-list-star.rkt")

View File

@ -119,7 +119,6 @@
(define (tag-pair dep)
(append (if (equal? (cdr dep) "lib/low.rkt") '(lib/low) '())
(if (equal? (cdr dep) "lib/low-untyped.rkt") '(lib/low) '())
(if (equal? (categorize-main-module (car dep))
(categorize-main-module (cdr dep))) '(submodule) '())
(if (lib? (cdr dep)) '(lib) '())))

View File

@ -137,6 +137,7 @@
(run! `(,(find-executable-path-or-fail "raco")
"make"
"-v"
"-j" "5"
,@rkt-files))

View File

@ -1069,10 +1069,9 @@ in a separate module (that will be used only by macros, so it will be written in
(module expander racket
(require racket
syntax/parse
syntax/stx
racket/format
syntax/id-table
"../lib/low-untyped.rkt")
(submod "../lib/low.rkt" untyped))
(require (for-template typed/racket))
@ -1101,7 +1100,7 @@ We can finally define the overloaded forms, as well as the extra
racket/syntax
syntax/parse
syntax/parse/experimental/template
"../lib/low-untyped.rkt")
(submod "../lib/low.rkt" untyped))
"../lib/low.rkt")
(require (submod ".." expander))
@ -1159,7 +1158,7 @@ And, last but not least, we will add a @tc[test] module.
"../lib/low.rkt"
(for-syntax (submod ".." expander)
racket/list
"../lib/low-untyped.rkt"))
(submod "../lib/low.rkt" untyped)))
<test-expand-type>