Subject: Re: Tracing local functions (or 'labels 'flet) with CMUCL
From: (Rob Warnock)
Date: Mon, 08 Sep 2003 06:40:04 -0500
Newsgroups: comp.lang.lisp
Message-ID: <>
Eric Marsden  <> wrote:
| Damien Kick <> writes:
| dk> Would someone be able to give an example of doing something useful
| dk> with the :FUNCTION option to CMUCL's TRACE?  
| TRACE is a macro; the argument to the :FUNCTION option is evaluated.

Hmmm... One learns something every day. Let's see here...

	appsrv> (third *http-servers*)

	               :PORT 80 :DOC-ROOT "/usr/local/www/data")
	appsrv> (uri-handler-function
		  (find-uri-handler "/foo.lhp" (third *http-servers*)))

	#<Closure Over ORG.RPW3.CGI.LHP::CACHED-LHP-PAGE-FUNC {4853FB51}>

[Note: This is an anonymous function created earlier when the
"foo.lhp" page was demand-loaded.]

	appsrv> (trace :function *)

	(#<Closure Over ORG.RPW3.CGI.LHP::CACHED-LHP-PAGE-FUNC {4853FB51}>)

And at this point, hit the "Reload" button on the browser, and...

	; Sep  8 03:25:42.56 cgi-sock[14]: GET "/"
		   :STREAM #<Stream for descriptor 15>
		   :CGI-ENV (# # # # # ...)
		   :SELF "/foo.lhp"
	  0: #<Closure Over Function ORG.RPW3.CGI.LHP::CACHED-LHP-PAGE-FUNC
	       {4853FB51}> returned

Wow, neat! Didn't know you could do that. Thanks, Eric!


Rob Warnock, PP-ASEL-IA		<>
627 26th Avenue			<URL:>
San Mateo, CA 94403		(650)572-2607