Re: tracing a function without knowing its name



jimka <jimka@xxxxxxxxx> wrote:
Does anyone know how (or at least how with sbcl) to trace a function
object without knowing its name?

CL-USER> (defparameter *a* (lambda () 1))
*A*
CL-USER> (trace #.*a* :encapsulate nil)
(#<FUNCTION (LAMBDA #) {1003AC0109}>)
CL-USER> (funcall *a*)
0: ((LAMBDA ()))
0: #<FUNCTION (LAMBDA #) {1003AC0109}> returned 1
1

(Though beware that TRACE with :ENCAPSULATE NIL doesn't work on all
platforms that sbcl supports).

--
Juho Snellman
.



Relevant Pages