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

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

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@x
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

Scheme-reports mailing list