racket-collections icon indicating copy to clipboard operation
racket-collections copied to clipboard

`has-key?` function for `indexable` interface

Open jackfirth opened this issue 8 years ago • 1 comments

I'm attempting to make some lenses that view maybes of indexables, but there's no way to test if a key is in an indexable. I was expecting some sort of has-key? complement to ref, where (has-key? indexable key) => #t implies that (ref indexable key) won't throw. Is this something that should be part of the indexable interface?

jackfirth avatar Feb 27 '17 03:02 jackfirth

Bluntly, yes, there’s no reason for this not to exist. Feel free to open a PR to add it.

lexi-lambda avatar Mar 03 '17 22:03 lexi-lambda