From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Herbert Euler" Newsgroups: gmane.emacs.devel Subject: Re: Macro vs Function Date: Thu, 13 Apr 2006 00:14:39 +0800 Message-ID: References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; format=flowed X-Trace: sea.gmane.org 1144858554 27949 80.91.229.2 (12 Apr 2006 16:15:54 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 12 Apr 2006 16:15:54 +0000 (UTC) Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Apr 12 18:15:51 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1FTi0G-0006W6-Qc for ged-emacs-devel@m.gmane.org; Wed, 12 Apr 2006 18:15:37 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FTi0G-0003Vb-6E for ged-emacs-devel@m.gmane.org; Wed, 12 Apr 2006 12:15:36 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1FThzU-0003DI-Ra for emacs-devel@gnu.org; Wed, 12 Apr 2006 12:14:48 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1FThzS-0003Bx-8N for emacs-devel@gnu.org; Wed, 12 Apr 2006 12:14:48 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FThzR-0003Bq-WE for emacs-devel@gnu.org; Wed, 12 Apr 2006 12:14:46 -0400 Original-Received: from [64.4.26.44] (helo=hotmail.com) by monty-python.gnu.org with esmtp (Exim 4.52) id 1FTi4Z-0003oD-Lp for emacs-devel@gnu.org; Wed, 12 Apr 2006 12:20:03 -0400 Original-Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC; Wed, 12 Apr 2006 09:14:44 -0700 Original-Received: from 64.4.26.200 by by112fd.bay112.hotmail.msn.com with HTTP; Wed, 12 Apr 2006 16:14:39 GMT X-Originating-IP: [221.222.193.104] X-Originating-Email: [herberteuler@hotmail.com] X-Sender: herberteuler@hotmail.com In-Reply-To: Original-To: emacs-devel@gnu.org X-OriginalArrivalTime: 12 Apr 2006 16:14:44.0258 (UTC) FILETIME=[35F79020:01C65E4C] X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:52780 Archived-At: Now I think I've understood how macro works. A macro is equivalent to a "function" described as follows: 1. This function has the same body as the macro, and when calling this function, substitute all arguments with quoted ones. 2. Then the body of the function is evaluated, and a s-exp is returned. (`, \, and ,@ are treated as normal functions here.) All parameters are normal variables that have value of the orignal arguments. 3. Next, evaluated this s-exp. This will cause the same effect as the macro. Thank you, David Kastrup, Andreas Schwab, and Stuart D. Herring. This is I think the biggest step I made after studying (Emacs) Lisp. Regards, Guanpeng Xu _________________________________________________________________ Don't just search. Find. Check out the new MSN Search! http://search.msn.click-url.com/go/onm00200636ave/direct/01/