From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: pjb@informatimago.com (Pascal J. Bourguignon) Newsgroups: gmane.emacs.help Subject: Re: Is it possible for a macro to expand to nothing? Date: Tue, 24 Nov 2009 01:03:13 +0100 Organization: Informatimago Message-ID: <87y6lwbxha.fsf@galatea.local> References: <87r5rpccbh.fsf@galatea.local> <87iqd1c7qn.fsf@galatea.local> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1259023297 22474 80.91.229.12 (24 Nov 2009 00:41:37 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 24 Nov 2009 00:41:37 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Nov 24 01:41:30 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 1NCjTF-0005fc-N5 for geh-help-gnu-emacs@m.gmane.org; Tue, 24 Nov 2009 01:41:29 +0100 Original-Received: from localhost ([127.0.0.1]:33978 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NCjTF-0005yJ-BI for geh-help-gnu-emacs@m.gmane.org; Mon, 23 Nov 2009 19:41:29 -0500 Original-Path: news.stanford.edu!usenet.stanford.edu!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 48 Original-X-Trace: individual.net 0WKVD2UJ8SaIyj9loytg+QBT8P0ZeYS8hfQuugnlaa3gapt0jd Cancel-Lock: sha1:ZTcwZDc0YjJmNWExMzA4NmQzNjgzODAyNTg0NzJhZmFhYzU2NDQ3Ng== sha1:FBxMv7q/dioML4ewru3my1+PRYg= Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwAQMAAABtzGvEAAAABlBMVEUAAAD///+l2Z/dAAAA oElEQVR4nK3OsRHCMAwF0O8YQufUNIQRGIAja9CxSA55AxZgFO4coMgYrEDDQZWPIlNAjwq9 033pbOBPtbXuB6PKNBn5gZkhGa86Z4x2wE67O+06WxGD/HCOGR0deY3f9Ijwwt7rNGNf6Oac l/GuZTF1wFGKiYYHKSFAkjIo1b6sCYS1sVmFhhhahKQssRjRT90ITWUk6vvK3RsPGs+M1RuR mV+hO/VvFAAAAABJRU5ErkJggg== X-Accept-Language: fr, es, en X-Disabled: X-No-Archive: no User-Agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/22.3 (darwin) Original-Xref: news.stanford.edu gnu.emacs.help:174997 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:70068 Archived-At: "Drew Adams" writes: >> > Huh? It produces the list ((setq bar 2)), assuming `ifdef' >> > acts like `and' >> >> Yes. And ((setq bar 2)) is not a valid form. > > Of course it's valid - it's a list. I'm using this definition: form n. 1. any object meant to be evaluated. 2. a symbol, a compound form, or a self-evaluating object. 3. (for an operator, as in ``<> form'') a compound form having that operator as its first element. ``A quote form is a constant form.'' (eval '((setq bar 2))) --> Debugger entered--Lisp error: (invalid-function (setq bar 2)) Therefore ((setq bar 2)) is not valid form. > Perhaps you are trying to _evaluate_ it? Yes, that's what the result of macro calls should, at leat potentially, be done with. > [And BTW, a sexp whose evaluation raises an error is not necessarily "invalid". > Validation requires validation against something (e.g. a syntax definition or a > specification). Lisp _syntax_ can be said to be invalid if it raises a read-time > error. But just because evaluating a sexp raises an error doesn't mean the > syntax is invalid. The list (bar) is not "invalid" if evaluating it raises the > error that bar's function definition is void.] If that was the case, then in a protected environment like lisp, everything is valid, as long as we don't stumble upon a crashing bug in the implementation. But it is more useful to distinguish forms doing something useful for the user or programmers from those signaling errors systematically, because of their intrinsic nature (because they're invalid forms). -- __Pascal Bourguignon__