From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Kevin Ryde Newsgroups: gmane.lisp.guile.devel Subject: Re: while break and continue Date: Tue, 29 Jul 2003 10:23:12 +1000 Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Message-ID: <8765lmkwpb.fsf@zip.com.au> References: <87isrtmhfw.fsf@zip.com.au> <87he79ic44.fsf@zagadka.ping.de> <878yshe1ux.fsf@zip.com.au> <87n0gf0zbc.fsf@zagadka.ping.de> <87fzm3m2n9.fsf@zip.com.au> <87smosrpp0.fsf@zagadka.ping.de> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1059438345 28779 80.91.224.249 (29 Jul 2003 00:25:45 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Tue, 29 Jul 2003 00:25:45 +0000 (UTC) Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Tue Jul 29 02:25:44 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 19hIJD-0007Tu-00 for ; Tue, 29 Jul 2003 02:25:43 +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 19hIHq-0003xr-Vm for guile-devel@m.gmane.org; Mon, 28 Jul 2003 20:24:18 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.20) id 19hIHK-0003p2-WA for guile-devel@gnu.org; Mon, 28 Jul 2003 20:23:46 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.20) id 19hIGz-0003TA-RS for guile-devel@gnu.org; Mon, 28 Jul 2003 20:23:25 -0400 Original-Received: from snoopy.pacific.net.au ([61.8.0.36]) by monty-python.gnu.org with esmtp (Exim 4.20) id 19hIGw-0003Lr-8P for guile-devel@gnu.org; Mon, 28 Jul 2003 20:23:22 -0400 Original-Received: from sunny.pacific.net.au (sunny.pacific.net.au [203.2.228.40]) by snoopy.pacific.net.au (8.12.3/8.12.3/Debian-6.4) with ESMTP id h6T0NJiI006803 for ; Tue, 29 Jul 2003 10:23:19 +1000 Original-Received: from wisma.pacific.net.au (wisma.pacific.net.au [210.23.129.72]) by sunny.pacific.net.au with ESMTP id h6T0NJQg007715 for ; Tue, 29 Jul 2003 10:23:19 +1000 (EST) Original-Received: from localhost (ppp97.dyn228.pacific.net.au [203.143.228.97]) by wisma.pacific.net.au (8.12.9/8.12.9) with ESMTP id h6T0NHaB016800 for ; Tue, 29 Jul 2003 10:23:17 +1000 (EST) Original-Received: from gg by localhost with local (Exim 3.35 #1 (Debian)) id 19hIGn-0001Qy-00; Tue, 29 Jul 2003 10:23:13 +1000 Original-To: guile-devel@gnu.org Mail-Copies-To: never In-Reply-To: <87smosrpp0.fsf@zagadka.ping.de> (Marius Vollmer's message of "27 Jul 2003 16:48:11 +0200") User-Agent: Gnus/5.090019 (Oort Gnus v0.19) Emacs/21.2 (gnu/linux) X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.2 Precedence: list List-Id: Developers list for Guile, the GNU extensibility library List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: main.gmane.org gmane.lisp.guile.devel:2665 X-Report-Spam: http://spam.gmane.org/gmane.lisp.guile.devel:2665 Marius Vollmer writes: > > Do you want to put it into boot-9.scm? Yes, I think it'd be good. Actually what I'd like to put in is something like (define-macro (while cond . body) (let* ((key (make-symbol "while-key")) (break-proc (lambda () (throw key #t))) (continue-proc (lambda () (throw key #f)))) `(,do ((break ,break-proc) (continue ,continue-proc)) ((,catch (,quote ,key) (,lambda () (,do () ((,not ,cond)) ,@body) #t) ,(lambda (key arg) arg)))))) All the backquoting being designed to protect against local bindings at expansion time. I know what you said about compiler friendliness, but I think for the moment protection against local defines would be better. (I imagine a compiler might want to try to cooperate with application macros like this using only basic list or procedure stuff, through some sort of eval in a restricted environment or whatever. But no doubt plenty of people smarter than me have thought about such things before.) _______________________________________________ Guile-devel mailing list Guile-devel@gnu.org http://mail.gnu.org/mailman/listinfo/guile-devel