![](https://secure.gravatar.com/avatar/13663028cac36d0b9ff102354f298263.jpg?s=120&d=mm&r=g)
30 Sep
2008
30 Sep
'08
6:32 p.m.
Hi, I am trying to create a function that would return another function that generates draws from a beta distribution. Something like this: (defun make-beta-generator (a b) (letm ((rng (random-number-generator *mt19937* 0))) (lambda () ;; of course this won't work, letm deallocated rng (beta-rd rng a b)))) As the comment says, this does not work. Is there a way to prevent letm from deallocating rng (or achieve the effect I want by some other means)? Thanks, Tamas