diff --git a/collects/racket/private/hash.rkt b/collects/racket/private/hash.rkt index 223ee55e9d..f2a580d978 100644 --- a/collects/racket/private/hash.rkt +++ b/collects/racket/private/hash.rkt @@ -1,8 +1,8 @@ (module hash "pre-base.rkt" - (define (hash-domain table) + (define (hash-keys table) (hash-map table (λ (k v) k))) - (define (hash-range table) + (define (hash-values table) (hash-map table (λ (k v) v))) (define (hash->list table) @@ -26,8 +26,8 @@ (hash-set! table (car pairs) (cadr pairs)) (loop (cddr pairs))))) - (provide hash-domain - hash-range + (provide hash-keys + hash-values hash->list hash-set* hash-set*!)) \ No newline at end of file diff --git a/collects/scribblings/reference/hashes.scrbl b/collects/scribblings/reference/hashes.scrbl index 2be553d5c5..65a0ce4429 100644 --- a/collects/scribblings/reference/hashes.scrbl +++ b/collects/scribblings/reference/hashes.scrbl @@ -330,19 +330,19 @@ new value. @see-also-concurrency-caveat[]} -@defproc[(hash-domain [hash hash?]) +@defproc[(hash-keys [hash hash?]) (listof any/c)]{ Returns a list of the keys of @scheme[hash] in an unspecified order. See @scheme[hash-map] for information about modifying @scheme[hash] -during @scheme[hash-domain]. @see-also-concurrency-caveat[]} +during @scheme[hash-keys]. @see-also-concurrency-caveat[]} -@defproc[(hash-range [hash hash?]) +@defproc[(hash-values [hash hash?]) (listof any/c)]{ Returns a list of the values of @scheme[hash] in an unspecified order. See @scheme[hash-map] for information about modifying @scheme[hash] -during @scheme[hash-range]. @see-also-concurrency-caveat[]} +during @scheme[hash-values]. @see-also-concurrency-caveat[]} @defproc[(hash->list [hash hash?]) (listof (cons/c any/c any/c))]{ diff --git a/collects/tests/racket/basic.rktl b/collects/tests/racket/basic.rktl index cf99c666fe..9557d62ebb 100644 --- a/collects/tests/racket/basic.rktl +++ b/collects/tests/racket/basic.rktl @@ -2363,8 +2363,8 @@ (check-all-bad hash-iterate-key) (check-all-bad hash-iterate-value)) -(test (list 1 2 3) hash-domain #hasheq((1 . a)(2 . b)(3 . c))) -(test (list 'a 'b 'c) hash-range #hasheq((1 . a)(2 . b)(3 . c))) +(test (list 1 2 3) hash-keys #hasheq((1 . a)(2 . b)(3 . c))) +(test (list 'a 'b 'c) hash-values #hasheq((1 . a)(2 . b)(3 . c))) (test (list (cons 1 'a) (cons 2 'b) (cons 3 'c)) hash->list #hasheq((1 . a)(2 . b)(3 . c))) (err/rt-test (hash-set*! im-t 1 2) exn:fail?) @@ -2399,8 +2399,8 @@ (arity-test make-immutable-hash 1 1) (arity-test make-immutable-hasheq 1 1) -(arity-test hash-domain 1 1) -(arity-test hash-range 1 1) +(arity-test hash-keys 1 1) +(arity-test hash-values 1 1) (arity-test hash-count 1 1) (arity-test hash-ref 2 3) (arity-test hash-set! 3 3)