Well, yes I could do that, but I wanted an automatic (= elegant) solution...
(and I'm lazy :-}).

Lyle

----- Original Message ----- 
From: "Drew McDermott" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Friday, March 19, 2004 6:49 PM
Subject: Re: accessing function name within body during compilation


>
> > I use a simple macro PRINTVARS that is inserted within a function
definition for debugging, to print out the current value of symbols or
expressions. Thus,
> >
> >   (defun foo () .... (printvars bar baz) ....)
> >
> > generates a message like
> >
> >   PRINTVARS: BAR 1.234 BAZ "ixnay"
> >
> > when FOO is called. This is quite useful (and quicker than writing the
equivalent FORMAT calls), but what would be even nicer is that PRINTVARS
also print out the name of the function, thus,
> >
> >   PRINTVARS (called from FOO): BAR 1.234 BAZ "ixnay"
> >
> > especially if there is more than one function which includes a PRINTVARS
form. In order to do this, is there any way that one can automatically get
the function name in the necessary manner?
>
> Since you have to hand-craft each call to PRINTVARS, why not put in
> the function name explicitly?   You could write
>
>      (printvars foo bar baz)
>
> or, if you want to make it optional,
>
>      (printvars :in foo bar baz)
>
> -- 
>                                    -- Drew McDermott
>                                       Yale Computer Science Department
>



Reply via email to