[plt-scheme] hash-has-key?

From: Dave Herman (dherman at ccs.neu.edu)
Date: Sat Mar 28 08:41:55 EDT 2009

> Ah, thanks for the comparison, I had no idea that the difference
> between cc and ec was so big. This function does feel like something
> that should be provided as a primitive, though, since hash-ref
> obviously has to do this test internally.

Agreed. You make a very strong case:

1. It's not obvious how to implement.
2. Every possible implementation is awkward.
3. The performance varies drastically between those implementations.
4. The internal library has to have the logic in there somewhere anyway.

I'd add one more:

5. Because Scheme is untyped, it's not possible for hash-ref to return  
one standard "not found" value, so the API ought to provide a predicate.


Posted on the users mailing list.