* guix/memoization.scm (<cache>): New record type.
(define-lookup-procedure, define-update-procedure): New macros.
(cache-ref, cacheq-ref, cache-set!, cacheq-set!): New procedures.
(cached/mv, cachedq/mv, cached, cachedq): Use them instead of 'hash-ref'
and 'hash-set!'.
(%make-hash-table*): When 'profiled?' returns true, return a <cache>
object.
(define-cache-procedure): Adjust to show cache lookups and hits.
* guix/memoization.scm (%memoization-tables): New variable.
(%make-hash-table*, show-memoization-tables): New procedures.
(make-hash-table*): New macro.
Add top-level call to 'register-profiling-hook!'.
(memoize): Adjust to pass the resulting procedure to
'make-hash-table*'.
(%mlambda): Likewise.
Previously (mlambda () (define foo 2) bar) would trigger a syntax error.
* guix/memoization.scm (%mlambda): In the zero-argument case, move
BODY... to a lambda to allow for inner 'define' and such.