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

memo-catch



Actually, you'd want to bind the tag list AFTER you enter the catch
frame, but I agree it can be done. eg,

(defmacro memo-catch (tag &body forms)
  (let ((g (gentemp)))
    `(let ((,g ,tag))
       (*catch ,g
         (let ((*pending-tags* (cons ,g *pending-tags*)))
           ,@forms)))))

However, I assume REM's comment was for the sake of debugging, since it
might be helpful interactively in determining how to proceed a broken
program that had been written with ordinary primitives.

For what it's worth, a common argument against your MEMO-CATCH solution
goes something like: ``If I'd known that was the catch I needed to
memoize, I wouldn't have had to memoize it!''

-kmp