![](https://secure.gravatar.com/avatar/255491b4518bb427df99aa2f0f84345a.jpg?s=120&d=mm&r=g)
I'm using a hash-table as a cache, and had a problem with ensure-gethash. Some example code / output: CL-USER> (let ((h (make-hash-table))) (alexandria:ensure-gethash :x h (progn (format T "expensive computation~%") 1)) (alexandria:ensure-gethash :x h (progn (format T "expensive computation~%") 1))) expensive computation expensive computation 1 T CL-USER> This patch (created using git format-patch origin/master) converts ENSURE-GETHASH to a macro that only evaluates the default if we get to the setf branch. Has a check to create and call a lambda if the default value looks complicated (using CONSTANTP). After applying my patch, here's the output: CL-USER> (let ((h (make-hash-table))) (alexandria:ensure-gethash :x h (progn (format T "expensive computation~%") 1)) (alexandria:ensure-gethash :x h (progn (format T "expensive computation~%") 1))) expensive computation 1 T CL-USER> Thoughts? Thanks, -- Ryan Davis Acceleration.net Director of Programming Services 2831 NW 41st street, suite B Gainesville, FL 32606 Office: 352-335-6500 x 124 Fax: 352-335-6506