From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Marius Vollmer Newsgroups: gmane.lisp.guile.devel Subject: Re: while break and continue Date: 19 Jun 2003 00:56:55 +0200 Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Message-ID: <87n0gf0zbc.fsf@zagadka.ping.de> References: <87isrtmhfw.fsf@zip.com.au> <87he79ic44.fsf@zagadka.ping.de> <878yshe1ux.fsf@zip.com.au> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1055977611 10647 80.91.224.249 (18 Jun 2003 23:06:51 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Wed, 18 Jun 2003 23:06:51 +0000 (UTC) Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Thu Jun 19 01:06:48 2003 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 19Sm0t-0002lR-00 for ; Thu, 19 Jun 2003 01:06:48 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.20) id 19SlyO-0006PF-KY for guile-devel@m.gmane.org; Wed, 18 Jun 2003 19:04:12 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.20) id 19SlwZ-0005Bx-Db for guile-devel@gnu.org; Wed, 18 Jun 2003 19:02:19 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.20) id 19Sluh-0004sa-7R for guile-devel@gnu.org; Wed, 18 Jun 2003 19:00:24 -0400 Original-Received: from mail.dokom.net ([195.253.8.218]) by monty-python.gnu.org with esmtp (Exim 4.20) id 19Slse-0003uK-QB for guile-devel@gnu.org; Wed, 18 Jun 2003 18:58:16 -0400 Original-Received: from dialin.speedway43.dip206.dokom.de ([195.138.43.206] helo=zagadka.ping.de) by mail.dokom.net with smtp (Exim 3.36 #3) id 19Slsr-00029Q-00 for guile-devel@gnu.org; Thu, 19 Jun 2003 00:58:29 +0200 Original-Received: (qmail 3706 invoked by uid 1000); 18 Jun 2003 22:56:55 -0000 Original-To: guile-devel@gnu.org In-Reply-To: <878yshe1ux.fsf@zip.com.au> Original-Lines: 47 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3 X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1b5 Precedence: list List-Id: Developers list for Guile, the GNU extensibility library List-Help: List-Post: List-Subscribe: , List-Archive: List-Unsubscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: main.gmane.org gmane.lisp.guile.devel:2555 X-Report-Spam: http://spam.gmane.org/gmane.lisp.guile.devel:2555 Kevin Ryde writes: > The code is still pretty ugly, I suppose that's what you get for > non-local exits :-). Maybe should have a caveat in the docs about > style, to discourage their use. Discourage the use of 'while' or merely 'continue' and 'break'? I think, pointing in the docs of 'while' to 'do' and the other ways of doing loops in Scheme would be good. I do think we definitely need to efficiently support non-Schemey styles, for the translators and maybe also for people used to them. But that should probably be done together with a compiler so that the common usage can be properly optimized. (A 'while' that doesn't use 'break' should not have a 'catch', etc...) Your macro is not necessarily he most efficient, but it is as efficient as possible without some kind of comiler-style analysis, I'd say. What is more important is the interface: does it have the right semantics? I think it does, and we should change our old while to your new version, even if the implementation is ugly and maybe inefficient. > I wonder if the value parameter for break should be optional, and > have while return unspecified when not given. That might be a > reasonably common usage. I think the value of a while loop is ill-specified anyway and we should always return unspecified. What should be returned when the condition becomes false? Your macro arranges to return #t, wich seems arbitrary. People who want their loop to return a specific value should use 'do', named 'let', or some other mechanism, I'd say. > Unless the whole thing is emulating some established > convention. Not that I know of. > Incidentally, where would be a good place to put some tests? > syntax.test maybe, or a new file? syntax.test seems fine. -- GPG: D5D4E405 - 2F9B BCCC 8527 692A 04E3 331E FAF8 226A D5D4 E405 _______________________________________________ Guile-devel mailing list Guile-devel@gnu.org http://mail.gnu.org/mailman/listinfo/guile-devel