[scheme-reports-wg2] Re: [Scheme-reports] Seeking review of sets and hash tables proposals John Cowan (26 May 2013 16:11 UTC)

[scheme-reports-wg2] Re: [Scheme-reports] Seeking review of sets and hash tables proposals John Cowan 26 May 2013 16:11 UTC

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@ccil.org>
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)

--
You received this message because you are subscribed to the Google Groups "scheme-reports-wg2" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scheme-reports-wg2+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.