From 138dec232988b93526478d64100b98f8a255a258 Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Tue, 8 Apr 2008 21:42:38 +0000 Subject: [PATCH] new hash function names and ops (3.99.0.23) svn: r9209 original commit: 021d4d7527f39cc01b6b8952f4a90e61e55e8956 --- collects/typed-scheme/private/base-env.ss | 23 ++++++++++----------- collects/typed-scheme/private/type-utils.ss | 6 +++--- 2 files changed, 14 insertions(+), 15 deletions(-) diff --git a/collects/typed-scheme/private/base-env.ss b/collects/typed-scheme/private/base-env.ss index 8c73784b..b777ed1e 100644 --- a/collects/typed-scheme/private/base-env.ss +++ b/collects/typed-scheme/private/base-env.ss @@ -372,19 +372,18 @@ [directory-list (cl-> [() (-lst -Path)] [(-Path) (-lst -Path)])] - [make-hash-table (let ([ht-opt (*Un (-val 'weak) (-val 'equal))]) - (-poly (a b) - (cl-> [() (-HT a b)] - [(ht-opt) (-HT a b)] - [(ht-opt ht-opt) (-HT a b)])))] + [make-hash (-poly (a b) (-> (-HT a b)))] + [make-hasheq (-poly (a b) (-> (-HT a b)))] + [make-weak-hash (-poly (a b) (-> (-HT a b)))] + [make-weak-hasheq (-poly (a b) (-> (-HT a b)))] - [hash-table-put! (-poly (a b) ((-HT a b) a b . -> . -Void))] - [hash-table-map (-poly (a b c) ((-HT a b) (a b . -> . c) . -> . (-lst c)))] - [hash-table-get (-poly (a b c) - (cl-> - (((-HT a b) a) b) - (((-HT a b) a (-> c)) (*Un b c)) - (((-HT a b) a c) (*Un b c))))] + [hash-set! (-poly (a b) ((-HT a b) a b . -> . -Void))] + [hash-map (-poly (a b c) ((-HT a b) (a b . -> . c) . -> . (-lst c)))] + [hash-ref (-poly (a b c) + (cl-> + (((-HT a b) a) b) + (((-HT a b) a (-> c)) (*Un b c)) + (((-HT a b) a c) (*Un b c))))] #;[hash-table-index (-poly (a b) ((-HT a b) a b . -> . -Void))] [bytes (->* (list) N -Bytes)] diff --git a/collects/typed-scheme/private/type-utils.ss b/collects/typed-scheme/private/type-utils.ss index 6053562f..c4e1fa84 100644 --- a/collects/typed-scheme/private/type-utils.ss +++ b/collects/typed-scheme/private/type-utils.ss @@ -23,7 +23,7 @@ ;; substitute : Type Name Type -> Type (define (substitute image name target) (define (sb t) (substitute image name t)) - (if (hash-table-get (free-vars* target) name #f) + (if (hash-ref (free-vars* target) name #f) (type-case sb target [#:F name* (if (eq? name* name) image target)]) target)) @@ -72,7 +72,7 @@ ;; fv : Type -> Listof[Name] -(define (fv t) (hash-table-map (free-vars* t) (lambda (k v) k))) +(define (fv t) (hash-map (free-vars* t) (lambda (k v) k))) ;; fv/list : Listof[Type] -> Listof[Name] -(define (fv/list ts) (hash-table-map (combine-frees (map free-vars* ts)) (lambda (k v) k))) +(define (fv/list ts) (hash-map (combine-frees (map free-vars* ts)) (lambda (k v) k)))