Email list hosting service & mailing list manager


Re: Fwd: [srfi-126] Draft #3. (#2) taylanbayirli@xxxxxx 12 Sep 2015 23:47 UTC

John Cowan <xxxxxx@mercury.ccil.org> writes:

> (hash-table-find pred table [ failure [ success ] ])
>
> Pred decides what association to use, failure and success process it.
>
> However, I'm now thinking that the success procedure should get both
> key and value throughout SRFI-125, rather than just value.

If optimizing

    (hash-table-find pred table
      (lambda ()
        (failure case))
      (lambda (k v)
        (success case)))

to not actually allocate procedures on the heap is an easy optimization
and will happen in the general case in a moderately good implementation,
then I have mostly no objections to that, although the key/value/found?
variant gives more flexibility, and only requires MV returns being
efficient.  It might also be easier to understand.

Taylan