Guest User

Untitled

a guest
Mar 7th, 2012
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. (define (caching f)
  2.   (define ht (make-hash))
  3.   (lambda (x)
  4.     (let ((y (hash-ref ht x #f)))
  5.       (hash-set! ht x (or y (f x))))
  6.     y))
Advertisement
Add Comment
Please, Sign In to add comment