From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Josef Wolf Newsgroups: gmane.lisp.guile.user Subject: Re: Need help with a macro Date: Mon, 16 Nov 2009 18:20:45 +0100 Message-ID: <20091116172045.GE29831@raven.wolf.lan> References: <20091115163303.GD29831@raven.wolf.lan> <87lji7h6ul.fsf@ossau.uklinux.net> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1258395242 30894 80.91.229.12 (16 Nov 2009 18:14:02 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 16 Nov 2009 18:14:02 +0000 (UTC) To: guile-user@gnu.org Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Mon Nov 16 19:13:55 2009 Return-path: Envelope-to: guile-user@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1NA65K-0007mi-3B for guile-user@m.gmane.org; Mon, 16 Nov 2009 19:13:54 +0100 Original-Received: from localhost ([127.0.0.1]:43305 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NA65J-0001cG-EH for guile-user@m.gmane.org; Mon, 16 Nov 2009 13:13:53 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NA5PE-0000yU-05 for guile-user@gnu.org; Mon, 16 Nov 2009 12:30:24 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NA5P8-0000wG-Aj for guile-user@gnu.org; Mon, 16 Nov 2009 12:30:22 -0500 Original-Received: from [199.232.76.173] (port=42919 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NA5P8-0000w1-0j for guile-user@gnu.org; Mon, 16 Nov 2009 12:30:18 -0500 Original-Received: from quechua.inka.de ([193.197.184.2]:43041 helo=mail.inka.de) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1NA5P6-00080e-Bq for guile-user@gnu.org; Mon, 16 Nov 2009 12:30:17 -0500 Original-Received: from raven.inka.de (uucp@[127.0.0.1]) by mail.inka.de with uucp (rmailwrap 0.5) id 1NA5P1-0005YH-VL; Mon, 16 Nov 2009 18:30:12 +0100 Original-Received: by raven.inka.de (Postfix, from userid 1000) id 6CDF42CE50; Mon, 16 Nov 2009 18:20:45 +0100 (CET) Mail-Followup-To: Josef Wolf , guile-user@gnu.org Content-Disposition: inline In-Reply-To: <87lji7h6ul.fsf@ossau.uklinux.net> User-Agent: Mutt/1.5.17 (2007-11-01) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.4-2.6 X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: guile-user-bounces+guile-user=m.gmane.org@gnu.org Errors-To: guile-user-bounces+guile-user=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.user:7486 Archived-At: On Sun, Nov 15, 2009 at 08:26:58PM +0000, Neil Jerram wrote: > Josef Wolf writes: > > I am trying to work through the little schemer book. In order to make it > > easier to go through the examples, I've come up with the following macro: > > [ ... ] > > The body of a define-macro definition is supposed to return the code > that should be substituted in place of the original macro call. With > the newlines there, the body returns *unspecified*, because that is what > (newline) returns. OK, I think I see the problem now... > Do you want those newlines to happen at macro-expansion time or eval > time? If the latter (which I would guess), the code that you want is > > (define-macro (disp exp) > (display exp) (newline) > `(begin > (display ,exp) > (newline) (newline))) Works great. Thanks!