[Xotcl] coroutines

Gustaf Neumann neumann at wu-wien.ac.at
Thu Sep 30 08:21:30 CEST 2010


  On 29.09.10 19:58, Victor Mayevski wrote:
> Thank you Gustaf,
>
> Part of my original question, which still stands, was "would it be worth it?"
>
> It seems that the example you provided can be done with XOTcl alone, no need for coroutine. Is there any case where coroutine would actually give some extra power to XOTcl? Forgive me, I am not a C programmer so the concept of NRE or stackless TCL is a little foggy to me.
In general, everything done with coroutines can be computed 
as well without it.  At the end, coroutines are a question 
of style. There is hope that for certain classes of 
problems, coroutines help to reduce complexity for the 
developer (who has learned how to use coroutines). Typical 
application areas are generators (i.e. technically speaking 
infinite loops that are suspended after each result, the 
generator example) and event driven programs suspending from 
time to time their execution. While traditionally event 
driven programs require to split up the logic into small 
functions (i have to admit to like this), coroutines 
facilitate a linear programming style.

Coroutines are certainly an interesting concept. Whether or 
not it is "being worth it" can only be estimated by the eye 
of the beholder.

-gustaf neumann


More information about the Xotcl mailing list