From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Linas Vepstas Newsgroups: gmane.lisp.guile.user Subject: Re: Guile continuations Date: Sat, 22 Aug 2009 10:26:40 -0500 Message-ID: <3ae3aa420908220826r3eae4ce9p4f3502e5eba5de54@mail.gmail.com> References: <3ae3aa420908211653k78e79c9bsb321acfbabbae663@mail.gmail.com> <20090822030824.GD7342@localhost> Reply-To: linasvepstas@gmail.com NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1250954820 27447 80.91.229.12 (22 Aug 2009 15:27:00 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 22 Aug 2009 15:27:00 +0000 (UTC) To: guile-user@gnu.org Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Sat Aug 22 17:26:54 2009 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.50) id 1MesUW-0001gw-Pv for guile-user@m.gmane.org; Sat, 22 Aug 2009 17:26:53 +0200 Original-Received: from localhost ([127.0.0.1]:58522 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MesUW-0005wB-3Y for guile-user@m.gmane.org; Sat, 22 Aug 2009 11:26:52 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MesUQ-0005rQ-Bb for guile-user@gnu.org; Sat, 22 Aug 2009 11:26:46 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MesUL-0005gl-FB for guile-user@gnu.org; Sat, 22 Aug 2009 11:26:45 -0400 Original-Received: from [199.232.76.173] (port=38170 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MesUL-0005gU-BL for guile-user@gnu.org; Sat, 22 Aug 2009 11:26:41 -0400 Original-Received: from mail-yw0-f190.google.com ([209.85.211.190]:41944) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MesUK-00020u-UO for guile-user@gnu.org; Sat, 22 Aug 2009 11:26:41 -0400 Original-Received: by ywh28 with SMTP id 28so1865832ywh.27 for ; Sat, 22 Aug 2009 08:26:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:reply-to:in-reply-to :references:date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=FAFLXYmMOB53tNKLajyPO+pB9e/2DGkkYF+vqSpk3U8=; b=Ijv1E1ro3kbCCQghLPi72BR2IGxdc47vKxwBtvtf0nRzD3nRy1KaJWotzied4mTr5g kxqeUA/JC1hFZjrdCK0PW5qwD+jw+MddV1ajxfA0VJUHexCLzAZE59tSWwjeMaG83xOK jzS4iCtd1l1mKBtE+WmrOx7D3vY7OaFx30cVk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:reply-to:in-reply-to:references:date:message-id :subject:from:to:content-type:content-transfer-encoding; b=TyBmLhOQNvMUEaZ2HOs3MuMbDh/WaCT40M9OjYNtXkLpKpaO2+WnCm5avbbDUs0l5N 91qLBK3fhrv2hKt1DA7kixDem371DhrnVHVKdXrqAUvb2Y8+OvKunDY7Oyc6HkH+ElCL /Bqq+cLfPjKUGH8OZQ1E1EMsUWzX6f1uMVtho= Original-Received: by 10.101.91.20 with SMTP id t20mr2524814anl.188.1250954800214; Sat, 22 Aug 2009 08:26:40 -0700 (PDT) In-Reply-To: <20090822030824.GD7342@localhost> X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) 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:7417 Archived-At: 2009/8/21 Eric Cooper : > On Fri, Aug 21, 2009 at 06:53:29PM -0500, Linas Vepstas wrote: >> I'm trying to find an elegant way of multi-threading between C >> and scheme code, without actually using threads... Basically, >> I want to do some scheme stuff for a while, break off, run some >> C code for a while, then resume the scheme execution where >> I left off. > > You can implement coroutines using call/cc, and the coroutines can be > either Scheme or C code. Yes, thank you! Easy when you put it that way, and a great example too! I really like that simple straightforward fork/yield ... its so ... obvious ... once you see the answer. Sheesh. By contrast, googling "coroutine scheme" comes up with horrid messes. The wikipedia article on coroutines doesn't even link to a scheme version; the Wikipedia article on continuations could almost surely benefit from a cut-n-paste of your email. In fact, I'm planning on cut-n-pasting that into the talk page right now, if that's OK with you ... --linas