> On Oct 25, 2019, at 7:28 AM, Thomas Dickerson 
> <thomas_dicker...@alumni.brown.edu> wrote:
> 
> For reasons that are unclear to me, hash-keys and dict-keys both return a 
> list? instead of a set?(frankly, this seems like a bug in the API...).


A dict doesn't guarantee unique keys. So `dict-keys` returns a list, not a set. 

#lang racket
(require racket/dict)
(define kvs '((a 1) (a 2)))
(dict? kvs) ; #t
(dict-keys kvs) ; '(a a)

Why does `hash-keys` also return a list? For consistency, I suppose, because 
every hash is a dict.

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/0D154CA9-581E-48DB-8C32-EA37A7A25112%40mbtype.com.

Reply via email to