From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Neil Jerram Newsgroups: gmane.lisp.guile.devel Subject: Re: macros, procedure->macro Date: 14 Jul 2002 16:23:09 +0100 Sender: guile-devel-admin@gnu.org Message-ID: References: <200207122236.56581.unknown_lamer@unknownlamer.org> NNTP-Posting-Host: localhost.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1026660462 18684 127.0.0.1 (14 Jul 2002 15:27:42 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Sun, 14 Jul 2002 15:27:42 +0000 (UTC) Cc: Dirk Herrmann , 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 17TlHh-0004rF-00 for ; Sun, 14 Jul 2002 17:27:41 +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 17TlIB-0006X9-00; Sun, 14 Jul 2002 11:28:11 -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 17TlHF-0006UJ-00; Sun, 14 Jul 2002 11:27:13 -0400 Original-Received: from portalet.ossau.uklinux.net (ppp-1-27.lond-b-3.access.uk.tiscali.com [80.40.13.27]) (authenticated) by s1.uklinux.net (8.11.6/8.11.6) with ESMTP id g6EFR9Q21215; Sun, 14 Jul 2002 16:27:09 +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 5F11616F9; Sun, 14 Jul 2002 16:29:08 +0000 (GMT) Original-To: Clinton Ebadi Original-Lines: 34 User-Agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/20.7 Errors-To: guile-devel-admin@gnu.org X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.0.11 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: Developers list for Guile, the GNU extensibility library List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.lisp.guile.devel:792 X-Report-Spam: http://spam.gmane.org/gmane.lisp.guile.devel:792 >>>>> "Clinton" == Clinton Ebadi writes: Clinton> On Friday 12 July 2002 20:09, Neil Jerram wrote: >> Thanks, that's helpful. So we won't support references to a macro >> that is defined in a following top-level form, as in: >> >> (define-macro (foo x) `(list ,(bar x) ,x)) >> (define-macro (bar x) `(* ,x ,x)) >> >> or is there a cunning plan that still allows us to support this? Clinton> Just use r5rs macros: Clinton> (use-modules (ice-9 syncase)) Clinton> (define-syntax foo (syntax-rules () ((foo x) (list (bar x) x)))) Clinton> (define-syntax bar (syntax-rules () ((bar x) (* x x)))) guile> (foo 5) Clinton> (25 5) Thanks for pointing this out. However, r5rs are by definition hygienic, one of the corollaries of which (if I understand correctly) is that it makes no difference when or how many times macros are expanded. With r5rs macros, therefore, we can easily delay expansion as late as possible (e.g. immediately before evaluation) so as to support all kinds of recursive references. With non-hygienic macros, timing matters. So, if Guile wants to support non-hygienic macros at all (in addition to r5rs), it's important to be precise about when they are expanded. Regards, Neil _______________________________________________ Guile-devel mailing list Guile-devel@gnu.org http://mail.gnu.org/mailman/listinfo/guile-devel