From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Drew Adams" Newsgroups: gmane.emacs.help Subject: RE: Is it possible for a macro to expand to nothing? Date: Mon, 23 Nov 2009 08:03:06 -0800 Message-ID: <39B5881EEC9A404487C5CA2AFB93F034@us.oracle.com> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1258992238 12887 80.91.229.12 (23 Nov 2009 16:03:58 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 23 Nov 2009 16:03:58 +0000 (UTC) To: "'Alan Mackenzie'" , Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Nov 23 17:03:51 2009 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1NCbOD-0006Ep-H4 for geh-help-gnu-emacs@m.gmane.org; Mon, 23 Nov 2009 17:03:45 +0100 Original-Received: from localhost ([127.0.0.1]:49838 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NCbOD-00080c-6J for geh-help-gnu-emacs@m.gmane.org; Mon, 23 Nov 2009 11:03:45 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NCbNo-000801-Ff for help-gnu-emacs@gnu.org; Mon, 23 Nov 2009 11:03:20 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NCbNk-0007xN-TL for help-gnu-emacs@gnu.org; Mon, 23 Nov 2009 11:03:20 -0500 Original-Received: from [199.232.76.173] (port=52421 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NCbNk-0007xK-Lb for help-gnu-emacs@gnu.org; Mon, 23 Nov 2009 11:03:16 -0500 Original-Received: from rcsinet11.oracle.com ([148.87.113.123]:21763 helo=rgminet11.oracle.com) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1NCbNk-00026k-3G for help-gnu-emacs@gnu.org; Mon, 23 Nov 2009 11:03:16 -0500 Original-Received: from rgminet13.oracle.com (rcsinet13.oracle.com [148.87.113.125]) by rgminet11.oracle.com (Switch-3.3.1/Switch-3.3.1) with ESMTP id nANG3Eb4005065 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 23 Nov 2009 16:03:16 GMT Original-Received: from acsmt356.oracle.com (acsmt356.oracle.com [141.146.40.156]) by rgminet13.oracle.com (Switch-3.3.1/Switch-3.3.1) with ESMTP id nANFuPFo023711; Mon, 23 Nov 2009 16:03:17 GMT Original-Received: from abhmt006.oracle.com by acsmt358.oracle.com with ESMTP id 540206111258992187; Mon, 23 Nov 2009 10:03:07 -0600 Original-Received: from dradamslap1 (/130.35.178.194) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 23 Nov 2009 08:03:06 -0800 X-Mailer: Microsoft Office Outlook 11 In-Reply-To: Thread-Index: AcpsU9cU+zPlVCkzSvCo77H2eDr+owAAk3Eg X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579 X-Source-IP: acsmt356.oracle.com [141.146.40.156] X-Auth-Type: Internal IP X-CT-RefId: str=0001.0A090202.4B0AB23F.00DB:SCFMA4539814,ss=1,fgs=0 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 1) X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:70051 Archived-At: > 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.