[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

This page is part of the web mail archives of SRFI 69 from before July 7th, 2015. The new archives for SRFI 69 contain all messages, not just those from before July 7th, 2015.

*To*: Per Bothner <per@xxxxxxxxxxx>*Subject*: Re: should hash function upper bound be exclusive?*From*: Panu Kalliokoski <atehwa@xxxxxxxx>*Date*: Wed, 10 Aug 2005 09:36:10 +0300*Cc*: srfi-69@xxxxxxxxxxxxxxxxx*Delivered-to*: srfi-69@xxxxxxxxxxxxxxxxx*In-reply-to*: <42F8E871.5070903@xxxxxxxxxxx>*References*: <42F8E871.5070903@xxxxxxxxxxx>*User-agent*: Mutt/1.5.9i

On Tue, Aug 09, 2005 at 10:31:29AM -0700, Per Bothner wrote: > Current the 'bound' for hash functions is exclusive: the returned hash h > is such that (and (>= 0 h) (< h bound)). One might want the default > bound to be such that hashes range over the positive fixnums. But in > that case the bound would not be a fixnum: it would have to be one > larger than the largest fixnum. I think this is an implementation detail. If one wants hashes that range over the positive fixnums, one should definitely not try to find out the maximum fixnum and give that as a bound to (hash), but just use (hash) without a bound -- that is, with the default bound. The SRFI has been written to account exactly for this situation (even if one can't say anything very precise about it): it leaves for the implementation to pick a good default bound when the user supplies none. Besides, even if people did explicitly request a total-fixnumber-range hash, it would do no harm to leave just a few fixnum values out. So unless there are reasons like API intuitiveness for changing the bound parameter to be inclusive, I'll refrain from making changes. Panu -- personal contact: atehwa@xxxxxx, +35841 5323835, +3589 85619369 work contact: panu.kalliokoski@xxxxxxxxxxx, +35850 3678003 kotisivu (henkkoht): http://www.iki.fi/atehwa/ homepage (technical): http://sange.fi/~atehwa/

**References**:**should hash function upper bound be exclusive?***From:*Per Bothner

- Prev by Date:
**Re: hash for eq?** - Next by Date:
**Re: error in hash table reference implementation** - Previous by thread:
**Re: should hash function upper bound be exclusive?** - Next by thread:
**Re: error in hash table reference implementation** - Index(es):