Re: [racket-users] Efficient idiom for converting key-set of a hash-map into a hash-set

2019-10-26 Thread Jack Firth
A dict doesn't guarantee unique keys, but it *does* guarantee that dict-ref returns a single value and dict-set accepts a single value, which is really strange to guarantee if you're not also going to guarantee unique keys. Honestly, I think association-lists-as-dicts were a mistake. If you

Re: [racket-users] Efficient idiom for converting key-set of a hash-map into a hash-set

2019-10-26 Thread Matthew Butterick
> On Oct 25, 2019, at 7:28 AM, Thomas Dickerson > 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.