Re: Macro context (continued)
Hi, Art!
Your macro is just doing something else.
On Mon, Jul 11, 2011 at 5:30 PM, Art Obrezan <artobrezan@yahoo.com> wrote:
>
>
> (defmacro debug-context (var &body body)
> `(when (and (boundp (quote ,var))
> ,var)
> ,@body))
>
>
> Best,
> Art
>
>
> --- On Mon, 7/11/11, Erik Ronström <erik.ronstrom@doremir.com> wrote:
>
>
> Now we've been talking about debug logging, but imagining another context where performance was important, it would be very nice to have the expansion to be evaluated at compile time, so that
>
> (debug-context *test1* (debug-log "Log message"))
>
> would expand to
>
> (when *test1* (do-some-logging "Log message"))
>
> Of course, *test1* is still evauated at run time, but the expansion is made at compile time. Is this possible in CL?
> RegardsErik
>
>
--
Павел Анохин