From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Neil Jerram Newsgroups: gmane.lisp.guile.user Subject: Re: Macro expansion Date: Sat, 15 Jan 2011 20:39:16 +0000 Message-ID: <87lj2lgavf.fsf@ossau.uklinux.net> References: <13B7D376-7BFD-4236-B6EF-5BF70FE248B7@telia.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1295124252 31464 80.91.229.12 (15 Jan 2011 20:44:12 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 15 Jan 2011 20:44:12 +0000 (UTC) Cc: guile-user To: Hans Aberg Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Sat Jan 15 21:44:08 2011 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.69) (envelope-from ) id 1PeCyl-00087L-6c for guile-user@m.gmane.org; Sat, 15 Jan 2011 21:44:07 +0100 Original-Received: from localhost ([127.0.0.1]:48048 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PeCuC-0008Jf-Be for guile-user@m.gmane.org; Sat, 15 Jan 2011 15:39:24 -0500 Original-Received: from [140.186.70.92] (port=34082 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PeCu8-0008JT-7K for guile-user@gnu.org; Sat, 15 Jan 2011 15:39:21 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PeCu5-0007fT-Qy for guile-user@gnu.org; Sat, 15 Jan 2011 15:39:19 -0500 Original-Received: from mail3.uklinux.net ([80.84.72.33]:50141) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PeCu5-0007f9-Mn for guile-user@gnu.org; Sat, 15 Jan 2011 15:39:17 -0500 Original-Received: from arudy (unknown [78.149.119.15]) by mail3.uklinux.net (Postfix) with ESMTP id 194471F66AA; Sat, 15 Jan 2011 20:39:17 +0000 (GMT) Original-Received: from neil-laptop (unknown [192.168.11.3]) by arudy (Postfix) with ESMTP id 7D5573801E; Sat, 15 Jan 2011 20:39:16 +0000 (GMT) In-Reply-To: <13B7D376-7BFD-4236-B6EF-5BF70FE248B7@telia.com> (Hans Aberg's message of "Tue, 11 Jan 2011 14:34:15 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) X-detected-operating-system: by eggs.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:8365 Archived-At: Hans Aberg writes: > In the code below the 'loop' and 'begin' examples will execute the > while' loop, but if put into the body of a function, 'while' will not > run. So why, and how to fix it? > > Just copy and paste the examples below into guile. For the two first, > I get > 0123456789 > 0123456789done!3 > but for the third, the thunk, only > done!3 With my current Guile, scheme@(guile-user)> (version) $4 = "1.9.14.17-44f43" the third case behaves as you would expect: scheme@(guile-user)> ((lambda () (begin (loop ((define i 0)) (< i 10) ((set! i (+ i 1))) ((display i))) (display "done!") (+ 1 2) ) )) 0123456789done!$5 = 3 Regards, Neil