From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Andy Wingo Newsgroups: gmane.lisp.guile.bugs,gmane.lisp.guile.devel Subject: Re: [shift and reset, plus] "while" Date: Thu, 28 Apr 2011 14:15:20 +0200 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1303993084 17825 80.91.229.12 (28 Apr 2011 12:18:04 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 28 Apr 2011 12:18:04 +0000 (UTC) Cc: bug-guile@gnu.org, guile-devel To: Wolfgang J Moeller Original-X-From: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Thu Apr 28 14:18:00 2011 Return-path: Envelope-to: guile-bugs@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1QFQAR-0005km-Dx for guile-bugs@m.gmane.org; Thu, 28 Apr 2011 14:17:59 +0200 Original-Received: from localhost ([::1]:44377 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QFQAQ-0001GX-Ie for guile-bugs@m.gmane.org; Thu, 28 Apr 2011 08:17:58 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:52488) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QFQAN-0001FI-2P for bug-guile@gnu.org; Thu, 28 Apr 2011 08:17:55 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QFQAL-0005Gm-Vf for bug-guile@gnu.org; Thu, 28 Apr 2011 08:17:55 -0400 Original-Received: from a-pb-sasl-sd.pobox.com ([64.74.157.62]:40844 helo=sasl.smtp.pobox.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QFQAL-0004bz-Tt; Thu, 28 Apr 2011 08:17:53 -0400 Original-Received: from sasl.smtp.pobox.com (unknown [127.0.0.1]) by a-pb-sasl-sd.pobox.com (Postfix) with ESMTP id ED3BA4465; Thu, 28 Apr 2011 08:17:42 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; s=sasl; bh=cRaGNjlaX9sBaFcrPdVWVrd0Nt0=; b=Ve74vI 8Dtyjb27/2cTwz9Z2G7Sq9RpkBndtF8Y8lITYI/BNZkrEHwDDf0TPfJxtEAs+DCn 6kuCf7/TUBr0iKaYL5YV6+2wkBOFFjYkm7AV6GvmcLVxTU/zyn1uINEucCtKjK5O gP2yp1XElKCZFh1u0/qO0LcUqE5zfTX0/FGI8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; q=dns; s=sasl; b=k21mykvTgCgBDLv6RLDFzS4W7+EXmRTq ae8eeaTa1eifIXpDSHenLStcFOtND2Vi1q0kor3RB7Hf246tiqHUulwH0bysRXyU SUr0Ga+ovMRWxS6BwPvDafC3oQ1VhXeDiTX2xoWxbcwdikp7V2CaEla3i5/6259T rTj5d9w51zo= Original-Received: from a-pb-sasl-sd.pobox.com (unknown [127.0.0.1]) by a-pb-sasl-sd.pobox.com (Postfix) with ESMTP id CA4E24462; Thu, 28 Apr 2011 08:17:39 -0400 (EDT) Original-Received: from unquote.localdomain (unknown [90.164.198.39]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by a-pb-sasl-sd.pobox.com (Postfix) with ESMTPSA id 04D76445F; Thu, 28 Apr 2011 08:17:36 -0400 (EDT) In-Reply-To: (Wolfgang J. Moeller's message of "Wed, 13 Apr 2011 19:31:32 +0200 (CEST)") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux) X-Pobox-Relay-ID: 82AA43F0-7191-11E0-955E-E8AB60295C12-02397024!a-pb-sasl-sd.pobox.com X-detected-operating-system: by eggs.gnu.org: Solaris 10 (beta) X-Received-From: 64.74.157.62 X-BeenThere: bug-guile@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Bug reports for GUILE, GNU's Ubiquitous Extension Language" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Original-Sender: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.bugs:5534 gmane.lisp.guile.devel:12368 Archived-At: On Wed 13 Apr 2011 19:31, Wolfgang J Moeller writes: > Last resort: Once we do allow for argument(s) to (break), > > (while #t ... (break x) ... (break y) ...) If I understand you right, this is more like a coroutine, which could use an orthogonal form: (define-syntax with-yield (lambda (x) (syntax-case x () ((_ yield exp exp* ...) (identifier? #'yield) #'(let ((tag (make-prompt-tag))) (define (handler k . args) (define (resume . args) (call-with-prompt tag (lambda () (apply k args)) handler)) (apply values resume args)) (call-with-prompt tag (lambda () (let-syntax ((yield (syntax-rules () ((_ arg (... ...)) (abort-to-prompt tag arg (... ...)))))) exp exp* ...)) handler)))))) Then you can (with-yield yield (while #t ... (yield) ...)) Regards, Andy -- http://wingolog.org/