[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
memo-catch
- To: rpg @ SU-AI
- Subject: memo-catch
- From: Kent M Pitman <KMP @ MIT-MC>
- Date: Fri, 23 Nov 1984 22:48:00 -0000
- Cc: common-lisp @ SU-AI
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