guile-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Guile continuations


From: Linas Vepstas
Subject: Re: Guile continuations
Date: Sat, 22 Aug 2009 10:26:40 -0500

2009/8/21 Eric Cooper <address@hidden>:
> 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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]