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

[scheme-reports-wg2] Re: [Scheme-reports] Seeking review of sets and hash tables proposals John Cowan 28 May 2013 01:51 UTC

Alex Shinn scripsit:

> I also think the following utility is nice, as there is no other
> existing utility to use a hash-table as a cache with a single
> operation:
>
>   (hash-table-ref/cache! table key thunk)
>   => (hash-table-search
>       table key
>       (lambda (value update remove)
>         value)
>       (lambda (insert)
>         (let ((res (thunk)))
>           (insert res)
>           res)))

How is this different from hash-table-replace?

--
He made the Legislature meet at one-horse       John Cowan
tank-towns out in the alfalfa belt, so that     cowan@ccil.org
hardly nobody could get there and most of       http://www.ccil.org/~cowan
the leaders would stay home and let him go      --H.L. Mencken's
to work and do things as he pleased.              Declaration of Independence

--
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.