From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Andy Wingo Newsgroups: gmane.lisp.guile.bugs Subject: Re: Syntax transformers and definition order Date: Sun, 28 Mar 2010 14:50:57 +0200 Message-ID: References: <4BACB06D.10707@gnu.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1269781772 19175 80.91.229.12 (28 Mar 2010 13:09:32 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sun, 28 Mar 2010 13:09:32 +0000 (UTC) Cc: bug-guile@gnu.org To: Luca Saiu Original-X-From: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Sun Mar 28 15:09:26 2010 Return-path: Envelope-to: guile-bugs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1NvsF4-00075a-3V for guile-bugs@m.gmane.org; Sun, 28 Mar 2010 15:09:26 +0200 Original-Received: from localhost ([127.0.0.1]:60561 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Nvs5A-0000W5-EF for guile-bugs@m.gmane.org; Sun, 28 Mar 2010 08:59:12 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Nvrvz-0006Zw-H0 for bug-guile@gnu.org; Sun, 28 Mar 2010 08:49:43 -0400 Original-Received: from [140.186.70.92] (port=52821 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Nvrvx-0006Qd-RB for bug-guile@gnu.org; Sun, 28 Mar 2010 08:49:43 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1NvrvS-0005ry-QF for bug-guile@gnu.org; Sun, 28 Mar 2010 08:49:13 -0400 Original-Received: from a-pb-sasl-quonix.pobox.com ([208.72.237.25]:48455 helo=sasl.smtp.pobox.com) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NvrvS-0005ri-OA; Sun, 28 Mar 2010 08:49:10 -0400 Original-Received: from sasl.smtp.pobox.com (unknown [127.0.0.1]) by a-pb-sasl-quonix.pobox.com (Postfix) with ESMTP id A8FA8A502F; Sun, 28 Mar 2010 08:49:09 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; s=sasl; bh=/pStJFb+85sL7yuzQmcjjp9idoE=; b=KscY2X YmpeFniFlxj8U8cUje9O9FpK4HeGfkKa6An97wZYzXytQuwAxFqEjkXj9jpQwM1O ZvkU1ACUgl4xEkgZLMg65ccjQ0hqRKn9gmwb4bhL1he027i/h0NWyXUpo00Pty44 sFNklrMuZlosgYSspC6W0GobRIUMiRMN4bZbo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; q=dns; s=sasl; b=rdwImCsSnKs9FZ29x+Rwn5i5rm6gyUlB iv7Ppc4UA8lMIxX/5dg8mY4EDZWKe7TuJ1COrnRtCaIZdx7D9pj6CJuU3a0gHBL7 z8qovpogNiGD1wnGT6NwSGfFu2zbU+kG7UiGONPcO9tPCHhUqB4yftU1WEHuY1a3 CxvTK54gqp8= Original-Received: from a-pb-sasl-quonix. (unknown [127.0.0.1]) by a-pb-sasl-quonix.pobox.com (Postfix) with ESMTP id 96DA5A502E; Sun, 28 Mar 2010 08:49:08 -0400 (EDT) Original-Received: from unquote (unknown [82.123.111.19]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by a-pb-sasl-quonix.pobox.com (Postfix) with ESMTPSA id 074F3A502C; Sun, 28 Mar 2010 08:49:06 -0400 (EDT) In-Reply-To: <4BACB06D.10707@gnu.org> (Luca Saiu's message of "Fri, 26 Mar 2010 14:02:37 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.92 (gnu/linux) X-Pobox-Relay-ID: 4CEB1836-3A68-11DF-A4D6-D033EE7EF46B-02397024!a-pb-sasl-quonix.pobox.com X-detected-operating-system: by eggs.gnu.org: Solaris 10 (beta) X-BeenThere: bug-guile@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GUILE, GNU's Ubiquitous Extension Language" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Errors-To: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.bugs:4537 Archived-At: Greetings Luca, On Fri 26 Mar 2010 14:02, Luca Saiu writes: > ;;; Define a function calling a macro which is not yet defined: > (define (go) > (display (m 42))) > > ;;; Define the macro: > (define-macro (m form) > `(list ,form)) > > ;;; Call the function: > (go) I'm afraid that this is just how it is. Fortunately it's easy to fix, as you have seen. >From the NEWS: ** Macros need to be defined before their first use. It used to be that with lazy memoization, this might work: (define (foo x) (ref x)) (define-macro (ref x) x) (foo 1) => 1 But now, the body of `foo' is interpreted to mean a call to the toplevel `ref' function, instead of a macro expansion. The solution is to define macros before code that uses them. Regards, Andy -- http://wingolog.org/