[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Is it possible for a macro to expand to nothing?
From: |
Jeff Clough |
Subject: |
Re: Is it possible for a macro to expand to nothing? |
Date: |
Mon, 23 Nov 2009 11:49:00 -0500 (EST) |
From: Alan Mackenzie <acm@muc.de>
Date: Mon, 23 Nov 2009 14:56:47 +0000 (UTC)
> 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."
> ......)
I think the short answer to your question is no, you can't do what you
are asking with a macro like this. You are looking for what you would
get from a C pre-processor #ifdef and that's not what macros in Lisp
do. Lisp macros do more and different magic than the C pre-processor.
Jeff
- Re: Is it possible for a macro to expand to nothing?, (continued)
- Re: Is it possible for a macro to expand to nothing?, Pascal J. Bourguignon, 2009/11/24
- Message not available
- Re: Is it possible for a macro to expand to nothing?, Pascal J. Bourguignon, 2009/11/23
- RE: Is it possible for a macro to expand to nothing?, Drew Adams, 2009/11/23
- Message not available
- Re: Is it possible for a macro to expand to nothing?, Pascal J. Bourguignon, 2009/11/23
- RE: Is it possible for a macro to expand to nothing?, Drew Adams, 2009/11/23
- Message not available
- Re: Is it possible for a macro to expand to nothing?, Pascal J. Bourguignon, 2009/11/23
- Message not available
- Re: Is it possible for a macro to expand to nothing?, Alan Mackenzie, 2009/11/23
Re: Is it possible for a macro to expand to nothing?,
Jeff Clough <=