From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Lynn Winebarger Newsgroups: gmane.lisp.guile.devel Subject: Re: Syntax checks Date: Sat, 13 Apr 2002 13:28:26 -0500 Sender: guile-devel-admin@gnu.org Message-ID: <02041313282601.10649@locke.free-expression.org> References: NNTP-Posting-Host: localhost.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8bit X-Trace: main.gmane.org 1018722794 22310 127.0.0.1 (13 Apr 2002 18:33:14 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Sat, 13 Apr 2002 18:33:14 +0000 (UTC) Cc: Marius Vollmer , Guile Development List Return-path: Original-Received: from fencepost.gnu.org ([199.232.76.164]) by main.gmane.org with esmtp (Exim 3.33 #1 (Debian)) id 16wSKo-0005nj-00 for ; Sat, 13 Apr 2002 20:33:14 +0200 Original-Received: from localhost ([127.0.0.1] helo=fencepost.gnu.org) by fencepost.gnu.org with esmtp (Exim 3.34 #1 (Debian)) id 16wSKf-0002LM-00; Sat, 13 Apr 2002 14:33:05 -0400 Original-Received: from epimetheus.hosting4u.net ([209.15.2.70]) by fencepost.gnu.org with smtp (Exim 3.34 #1 (Debian)) id 16wSJT-00020s-00 for ; Sat, 13 Apr 2002 14:31:51 -0400 Original-Received: (qmail 15471 invoked from network); 13 Apr 2002 18:31:50 -0000 Original-Received: from leo.hosting4u.net (HELO free-expression.org) (209.15.2.51) by mail-gate.hosting4u.net with SMTP; 13 Apr 2002 18:31:50 -0000 Original-Received: from locke.free-expression.org ([156.56.117.86]) by free-expression.org ; Sat, 13 Apr 2002 13:31:46 -0500 Original-To: Neil Jerram , Dirk Herrmann X-Mailer: KMail [version 1.2] In-Reply-To: X-Rcpt-To: Errors-To: guile-devel-admin@gnu.org X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.0.9 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:367 X-Report-Spam: http://spam.gmane.org/gmane.lisp.guile.devel:367 On Saturday 13 April 2002 07:48, Neil Jerram wrote: > I broadly agree with your argument, but have just one question. Does > this last point mean that macro definitions will only work if they are > placed _before_ any expressions that use them? Yes. > Or am I missing something cleverer here? Not that I know of. The productions of macro definitions don't get expanded until the macro is applied so recursive use is fine. Those productions should (lexically) scope to wherever the macro was defined (like a module) so that the problem of exporting extra syntax can be avoided. In some sense this should 'obvious' as macros are just lambdas and they scope lexically, on the other hand it's not since macros just produce new code and the evaluator isn't itself scoped to the lexical environment of the macro. What's the correct evaluation of (define-syntax foo (syntax-rules () ((_) (bar)))) (define-syntax bar (syntax-rules () ((_) 1))) (let-syntax ((bar (syntax-rules () ((_) 2)))) (foo)) I'd say it should be 1, even though (foo) produces (bar) in an environment with a new binding for bar. It should work the same way for modules. Lynn _______________________________________________ Guile-devel mailing list Guile-devel@gnu.org http://mail.gnu.org/mailman/listinfo/guile-devel