Replace uses of unstable/function and /list with the equivalent core libs.

This commit is contained in:
Vincent St-Amour 2015-07-16 17:13:15 -05:00
parent fca96dcdc1
commit 72fb041211
16 changed files with 37 additions and 32 deletions

View File

@ -25,7 +25,7 @@
(for-syntax
racket/base
syntax/parse)
unstable/sequence unstable/list unstable/hash
unstable/sequence unstable/hash
racket/list)
(import dmap^ constraints^)
@ -261,7 +261,7 @@
;; One is null-end the other is uniform-end
[((seq ss (null-end))
(seq ts (uniform-end t-rest)))
(cgen/list context ss (extend ss ts t-rest))]
(cgen/list context ss (list-extend ss ts t-rest))]
[((seq ss (uniform-end s-rest))
(seq ts (null-end)))
#f]
@ -270,7 +270,7 @@
(seq ts (uniform-end t-rest)))
(cgen/list context
(cons s-rest ss)
(cons t-rest (extend ss ts t-rest)))]
(cons t-rest (list-extend ss ts t-rest)))]
;; dotted below, nothing above
[((seq ss (dotted-end dty dbound))
(seq ts (null-end)))
@ -358,7 +358,7 @@
(% cset-meet
(cgen/list context ss (if (positive? length-delta)
(drop-right ts length-delta)
(extend ss ts t-rest)))
(list-extend ss ts t-rest)))
(% move-vars+rest-to-dmap
(% cset-meet
(cgen/list (context-add context #:bounds (list new-bound) #:vars vars #:indices (list new-bound))
@ -851,7 +851,7 @@
;; like infer, but T-var is the vararg type:
(define (infer/vararg X Y S T T-var R [expected #f])
(define new-T (if T-var (extend S T T-var) T))
(define new-T (if T-var (list-extend S T T-var) T))
(and ((length S) . >= . (length T))
(infer X Y S new-T R expected)))

View File

@ -2,7 +2,7 @@
(require syntax/parse
racket/match
unstable/function
racket/function
syntax/parse/experimental/specialize
(for-template racket/base racket/unsafe/ops)
"../utils/utils.rkt" "../utils/tc-utils.rkt"

View File

@ -17,7 +17,6 @@
racket/promise
racket/format
racket/match
(only-in unstable/list check-duplicate)
"parse-classes.rkt"
(for-label
(except-in racket/base case-lambda)

View File

@ -15,7 +15,6 @@
racket/match racket/syntax racket/list
racket/format
racket/dict
unstable/list
syntax/flatten-begin
(only-in (types abbrev) -Bottom)
(static-contracts instantiate optimize structures combinators)

View File

@ -1,7 +1,7 @@
#lang racket/base
(require "../utils/utils.rkt"
unstable/list unstable/sequence syntax/id-table racket/dict racket/syntax
unstable/sequence syntax/id-table racket/dict racket/syntax
racket/struct-info racket/match syntax/parse
(only-in (private type-contract) include-extra-requires?)
(private syntax-properties)
@ -90,11 +90,11 @@
(define type-is-constructor? #t) ;Conservative estimate (provide/contract does the same)
(match-define (list type-desc constr pred (list accs ...) muts super) (extract-struct-info si))
(define-values (defns export-defns new-ids aliases)
(map/values 4
(lambda (e) (if (identifier? e)
(mk e)
(mk-ignored-quad e)))
(list* type-desc pred super accs)))
(for/lists (defns export-defns new-ids aliases)
([e (in-list (list* type-desc pred super accs))])
(if (identifier? e)
(mk e)
(mk-ignored-quad e))))
;; Here, we recursively handle all of the identifiers referenced
;; in this static struct info.
(define-values (constr-defn constr-export-defn constr-new-id constr-aliases)

View File

@ -1,7 +1,7 @@
#lang racket/base
(require "../utils/utils.rkt"
racket/match unstable/list unstable/sequence racket/set racket/list
racket/match unstable/sequence racket/set racket/list
(only-in racket/list make-list)
(contract-req)
(typecheck check-below tc-subst tc-metafunctions)
@ -119,8 +119,8 @@
(format "Wrong number of arguments - Expected ~a, but got ~a\n\n" (length (car doms)) (length arg-tys))
"")
(append
(for/list ([dom-t (in-list (extend arg-tys (car doms) #f))]
[arg-t (in-list (extend (car doms) arg-tys #f))]
(for/list ([dom-t (in-list (list-extend arg-tys (car doms) #f))]
[arg-t (in-list (list-extend (car doms) arg-tys #f))]
[i (in-naturals 1)])
(let ([dom-t (or dom-t "-none-")]
[arg-t (or arg-t "-none-")])

View File

@ -4,7 +4,7 @@
"signatures.rkt"
"utils.rkt"
syntax/parse racket/match
unstable/list syntax/stx
syntax/stx
unstable/sequence
(typecheck signatures tc-funapp)
(types abbrev utils)
@ -44,9 +44,9 @@
[(tc-result1: (and t Poly?))
(tc-expr/check #'quo (ret Univ))
(tc/funapp #'op #'(quo arg)
(instantiate-poly t (extend (list Univ Univ)
(stx-map type-annotation #'(i ...))
Univ))
(instantiate-poly t (list-extend (list Univ Univ)
(stx-map type-annotation #'(i ...))
Univ))
(list (ret Univ) (single-value #'arg))
expected)]))
;; special-case for not - flip the filters

View File

@ -2,7 +2,6 @@
(require (rename-in "../utils/utils.rkt" [infer infer-in]))
(require racket/match racket/list
(only-in unstable/list list-update)
(for-syntax racket/base syntax/parse)
(contract-req)
(infer-in infer)

View File

@ -9,7 +9,7 @@
(only-in (infer infer) restrict)
(utils stxclass-util)
syntax/parse
unstable/function
racket/function
unstable/sequence
racket/extflonum)

View File

@ -2,7 +2,7 @@
(require (rename-in "../utils/utils.rkt" [infer r:infer])
racket/syntax syntax/parse syntax/stx syntax/id-table
racket/list unstable/list racket/dict racket/match unstable/sequence
racket/list racket/dict racket/match unstable/sequence
(prefix-in c: (contract-req))
(rep type-rep)
(types utils abbrev type-table struct-table)
@ -27,6 +27,10 @@
(define-logger online-check-syntax)
(define (filter-multiple l . fs)
(apply values
(map (lambda (f) (filter f l)) fs)))
(define unann-defs (make-free-id-table))
(define (parse-typed-struct form)
@ -542,4 +546,3 @@
(tc-toplevel/pass1.5 form)
(begin0 (tc-toplevel/pass2 form #f)
(report-all-errors))]))

View File

@ -9,7 +9,7 @@
racket/match
racket/function
racket/undefined
unstable/function
racket/function
(prefix-in c: (contract-req))
(rename-in (rep type-rep filter-rep object-rep)

View File

@ -14,7 +14,6 @@
racket/match
syntax/parse
syntax/stx
(only-in unstable/list check-duplicate)
(only-in unstable/sequence in-syntax)
(for-template (base-env class-clauses)))

View File

@ -4,7 +4,7 @@
(rename-in (types numeric-predicates base-abbrev)
[simple-Un *Un])
(rename-in (rep type-rep) [make-Base make-Base*])
unstable/function
racket/function
racket/extflonum
;; For base type contracts
(for-template racket/base racket/contract/base racket/extflonum (types numeric-predicates)))

View File

@ -17,7 +17,9 @@ at least theoretically.
;; logging
show-input?
;; provide macros
rep utils typecheck infer env private types static-contracts)
rep utils typecheck infer env private types static-contracts
;; misc
list-extend)
(define optimize? (make-parameter #t))
(define-for-syntax enable-contracts? (and (getenv "PLT_TR_CONTRACTS") #t))
@ -200,3 +202,8 @@ at least theoretically.
(self-ctor-transformer (struct-info-self-ctor-id ins) stx))
#:property prop:struct-info (λ (x) (extract-struct-info (struct-info-self-ctor-info x))))
struct-info-self-ctor))
;; Listof[A] Listof[B] B -> Listof[B]
;; pads out t to be as long as s
(define (list-extend s t extra)
(append t (build-list (max 0 (- (length s) (length t))) (lambda _ extra))))

View File

@ -13,8 +13,7 @@
"racket-index"
"pconvert-lib"
"compatibility-lib"
"unstable-flonum-lib"
"unstable-list-lib"))
"unstable-flonum-lib"))
(define build-deps '("scheme-lib"
"base"
"racket-benchmarks"

View File

@ -5,9 +5,9 @@
;; certain types are recorded at the right locations.
(require "test-utils.rkt"
racket/list
racket/match
rackunit
unstable/list
(for-syntax racket/base))
(provide tests)