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

Re: [Scheme-reports] Seeking review of sets and hash tables proposals

Alexey Radul scripsit:

> The proposal does not actually specify the interface of a
> (user-supplied) hash function.  Some kinds of hash functions are more
> efficient to implement if they know the index range in advance, so
> they can use modular arithmetic internally.  Unfortunately, supplying
> this information to all hash functions needlessly complicates the
> interfaces of ones that do not take advantage of it.  It may also be
> the case that specifying that all hash tables have fewer than
> max-fixnum buckets may be sufficient (espcially if the underlying
> implementation offers an efficient *-mod operation that can be used to
> avoid consing intermediate bignums), though that sort of restriction
> has its own down sides.

I've decided to go with R6RS, which just says "a non-negative exact
integer", rather than providing the more complex interface of SRFI 69
(optional bound).

> I don't have a concrete suggestion, except to lament the asymmetry
> between function definitions (which are allowed to specify that some
> parameters are optional) and function call sites (which cannot specify
> that some of the arguments can be safely dropped if the callee doesn't
> need them).

As you say.

Schlingt dreifach einen Kreis vom dies!    John Cowan <cowan@x>
Schliesst euer Aug vor heiliger Schau,     http://www.ccil.org/~cowan
Denn er genoss vom Honig-Tau,
Und trank die Milch vom Paradies.            --Coleridge (tr. Politzer)

Scheme-reports mailing list