From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Neil Jerram Newsgroups: gmane.lisp.guile.user Subject: Re: macros, procedure->macro Date: 15 Jul 2002 23:42:09 +0100 Sender: guile-user-admin@gnu.org Message-ID: <25760.7774845839$1026773591@news.gmane.org> References: NNTP-Posting-Host: localhost.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1026773592 20589 127.0.0.1 (15 Jul 2002 22:53:12 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 15 Jul 2002 22:53:12 +0000 (UTC) Cc: guile-devel@gnu.org, guile-user@gnu.org Return-path: Original-Received: from fencepost.gnu.org ([199.232.76.164]) by main.gmane.org with esmtp (Exim 3.33 #1 (Debian)) id 17UEiL-0005Lr-00 for ; Tue, 16 Jul 2002 00:53:09 +0200 Original-Received: from localhost ([127.0.0.1] helo=fencepost.gnu.org) by fencepost.gnu.org with esmtp (Exim 3.35 #1 (Debian)) id 17UEhd-0003yO-00; Mon, 15 Jul 2002 18:52:25 -0400 Original-Received: from mail.uklinux.net ([80.84.72.21] helo=s1.uklinux.net) by fencepost.gnu.org with esmtp (Exim 3.35 #1 (Debian)) id 17UEgO-0003wg-00; Mon, 15 Jul 2002 18:51:08 -0400 Original-Received: from portalet.ossau.uklinux.net (ppp-0-137.lond-b-1.access.uk.tiscali.com [80.40.0.137]) (authenticated) by s1.uklinux.net (8.11.6/8.11.6) with ESMTP id g6FMoaU24812; Mon, 15 Jul 2002 23:50:36 +0100 Original-Received: from laruns.ossau.uklinux.net.ossau.uklinux.net (laruns.ossau.uklinux.net [192.168.1.3]) by portalet.ossau.uklinux.net (Postfix on SuSE Linux 7.2 (i386)) with ESMTP id BBA4F16FA; Mon, 15 Jul 2002 23:48:10 +0000 (GMT) Original-To: Dirk Herrmann In-Reply-To: Original-Lines: 44 User-Agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/20.7 Errors-To: guile-user-admin@gnu.org X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.0.11 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.lisp.guile.user:750 X-Report-Spam: http://spam.gmane.org/gmane.lisp.guile.user:750 >>>>> "Dirk" == Dirk Herrmann writes: Dirk> To clarify I would like to re-state my answer to a previous mail to you: Thanks - the following is exactly what I've been looking for. (I'm pretty sure that I have not previously received any such email, though.) Dirk> Macro expansion is neither performed like reading, nor like evaluation. Dirk> Macro expansion is blocked by quoting _and_ macro definitions. It is not Dirk> blocked by lambda or other special forms. Since macro expansion is Dirk> blocked by macro definitions, recursive macro definitions are possible. This sounds good. But, given that the code for a macro definition gets wrapped in a lambda, perhaps it would be simpler to say that all lambdas block macroexpansion, and that macroexpansion of the code inside the lambda happens when the lambda is first used. This seems well defined and easy to understand to me. Dirk> Given this, it should be clear why Dirk> (define (foo) (bar)) Dirk> (define-macro (bar) #f) Dirk> (foo) Dirk> will not work: The first line is expanded at once. In contrast, Dirk> (define-macro (foo x) `(list ,(bar x) ,x)) Dirk> (define-macro (bar x) `(* ,x ,x)) Dirk> will work, because the macro definition will not be expanded. If we follow the all lambdas idea, then the `define' example would work as well. Is there any reason why this would be a _bad_ thing? Dirk> However, it may be that different macro implementations with different Dirk> behaviours can co-exist. For example, I don't see why you shouldn't be Dirk> able to mix calls to procedure->memoizing-macro with calls to Dirk> define-macro. Then, for each of the different macro systems the behaviour Dirk> would have to be defined separately. Not all possible systems will comply Dirk> with the demand for a system that supports compilation and efficient Dirk> execution, though. In general, yes. I don't understand your specific example, though, as define-macro is implemented using procedure->memoizing-macro, so they are the same implementation. Neil _______________________________________________ Guile-user mailing list Guile-user@gnu.org http://mail.gnu.org/mailman/listinfo/guile-user