[racket] hash-ref

From: Neil Van Dyke (neil at neilvandyke.org)
Date: Sun Jul 18 18:21:45 EDT 2010

Jos Koot wrote at 07/18/2010 09:26 AM:
> (hash-ref a-hash a-key a-value)
> In the past a-value was required to be a procedure.
> Now it can be anything.
[...]
>  
> In short, I do not well understand the reason to relax the contract of 
> hash-ref and hash-ref!.

This behavior seems a little on the uncomfortable side of automagical to 
me, and -- although I can understand the desire to keep the short name 
-- I would've preferred separate procedures for the default-thunk and 
default-value variations.

Perhaps the short-name procedure could be the automagical one, and there 
could be longer-name procedures, like "hash-ref/default-thunk" and 
"hash-ref/default-value", for people who prefer a little less automagic 
in that regard.

-- 
http://www.neilvandyke.org/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20100718/89da73c8/attachment.html>

Posted on the users mailing list.