[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Why a defmacro that calls a defun?
From: |
Barry Margolin |
Subject: |
Re: Why a defmacro that calls a defun? |
Date: |
Tue, 03 Oct 2017 13:24:08 -0400 |
User-agent: |
MT-NewsWatcher/3.5.3b3 (Intel Mac OS X) |
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.
--
Barry Margolin, barmar@alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***