help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Is it possible for a macro to expand to nothing?


From: Drew Adams
Subject: RE: Is it possible for a macro to expand to nothing?
Date: Mon, 23 Nov 2009 08:03:06 -0800

> That is, not to a call to a null defun, but truly to nothing: 
> i.e., the
> ensuing code (as least, when byte compiled) will be identical 
> to what it
> would have been, had the macro invocation been omitted.
> 
> I want something like this:
> 
> (defmacro ifdef (condition &rest forms)
>   "If the compile time CONDITION is non-nil, dump the FORMS to the
> calling defun.  Otherwise do nothing."
>   ......)

Hi Alan,

I'm not sure what you mean. But if you mean something like "insert nothing",
then you can do that by producing nil and then using ,@ inside a backquote. IOW,
instead of inserting nil, you splice it in, which means inserting nothing.

HTH.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]