From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Marius Vollmer Newsgroups: gmane.lisp.guile.user Subject: Re: loop translations (was: Re: language translator help) Date: 28 Apr 2002 20:15:26 +0200 Sender: guile-user-admin@gnu.org Message-ID: <87bsc3elkx.fsf@zagadka.ping.de> References: <15561.38014.967466.255795@segfault.bogus.domain> <15563.18445.371647.751605@segfault.bogus.domain> <87adrondbl.fsf@zagadka.ping.de> <15564.1889.327611.808226@segfault.bogus.domain> NNTP-Posting-Host: localhost.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1020017617 5281 127.0.0.1 (28 Apr 2002 18:13:37 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Sun, 28 Apr 2002 18:13:37 +0000 (UTC) Cc: guile-user Return-path: Original-Received: from fencepost.gnu.org ([199.232.76.164]) by main.gmane.org with esmtp (Exim 3.33 #1 (Debian)) id 171tB2-0001N4-00 for ; Sun, 28 Apr 2002 20:13:37 +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 171t9z-0003Ww-00; Sun, 28 Apr 2002 14:12:31 -0400 Original-Received: from dialin.speedway42.dip189.dokom.de ([195.138.42.189] helo=zagadka.ping.de) by fencepost.gnu.org with smtp (Exim 3.34 #1 (Debian)) id 171t9B-0003VI-00 for ; Sun, 28 Apr 2002 14:11:41 -0400 Original-Received: (qmail 1039 invoked by uid 1000); 28 Apr 2002 18:15:26 -0000 Original-To: "John W. Eaton" In-Reply-To: <15564.1889.327611.808226@segfault.bogus.domain> Original-Lines: 47 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 Errors-To: guile-user-admin@gnu.org X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.0.9 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.lisp.guile.user:350 X-Report-Spam: http://spam.gmane.org/gmane.lisp.guile.user:350 "John W. Eaton" writes: > On 28-Apr-2002, Marius Vollmer wrote: > > | "John W. Eaton" writes: > | > | Your approach is essentially right. Let me try to formalize it a bit > | with some macros: > > Thanks. With the macros, the loops are much more readable to me, but > there is still the (apparent, at least to a Scheme novice) complexity > of call/cc. Yes, but I think it is properly encapsulated with 'with-exit'. > | The problem with the macros above is that they are not hygienic, > > Sorry, I'm not sure I understand what that means. They can shadow identifiers from the user. Code like (let ((continue #t)) (while continue (set! continue #f))) wont work since the 'continue' identifier inside the while does not refer to the one introduced by the let. A good solution would be to make the continue feature optional and let the user choose the name of the function. Much like 'with-exit', where the name of the exiting function is determined by the user, not the macro. > | avoiding call/cc is not so easy and is hopefully > | not really necessary. One could generate continuation-passing code > | and hope that Guile will execute it more efficiently than the > | occasional call/cc, > > What is continuation passing? Start here: http://www.scheme.com/tspl2d/further.html#g1849 > It's important to me that looping not be any slower than it already is > in Octave. I'd say you should first do the simple thing (using call/cc) and later worry about performance. _______________________________________________ Guile-user mailing list Guile-user@gnu.org http://mail.gnu.org/mailman/listinfo/guile-user