[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Why a defmacro that calls a defun?
From: |
Eric Abrahamsen |
Subject: |
Re: Why a defmacro that calls a defun? |
Date: |
Tue, 03 Oct 2017 11:20:56 -0700 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/26.0.60 (gnu/linux) |
Barry Margolin <barmar@alum.mit.edu> writes:
> In article <mailman.668.1506986797.27995.help-gnu-emacs@gnu.org>,
> Eric Abrahamsen <eric@ericabrahamsen.net> wrote:
>
>> I'm poking through Gnus, and seeing a fair number of places with code
>> that looks like this:
>>
>> (defmacro nnoo-define-skeleton (backend)
>> `(eval-and-compile
>> (nnoo-define-skeleton-1 ',backend)))
>>
>> (defun nnoo-define-skeleton-1 (backend)
>> ...)
>>
>> What does this actually do? All I can see happening is that a quote mark
>> is added before the BACKEND argument in the macro. What is happening
>> here?
>
> It just causes the function to be called at compile time as well as run
> time, due to the use of eval-and-compile.
Huh, thanks for that. I guess it's obvious, but it was not clicking for me.