I am new to lisp, and am learning as I go.
The standard common lisp break function 1. pops you into the debugger, and 2. if you choose to continue, returns nil.
It seems to me that a break function that popped you into the debugger but RETURNED ITS INPUT would be extremely useful. Then, you could just insert it transparently around a given s-expression to look at the state of the program at that point.
So I could do something like
CL-USER> (break-transparent (+ 1 2))
which would pop me into the debugger and let me look around and then would return
3
Is there such a thing in lisp, and, if not, is there a way to make such a thing? I am not good with macros yet.
Thanks,
EDIT: Doug Currie kindly answered this below with a simple macro. Here is my slightly modified version for anyone else with this question that displays the argument to break-transparent front and center in the debugger window.
(defmacro break-transparent (exp)
`(let ((x ,exp)) (break "argument to break: ~:S" x) x))