(Anyone not at yesterday's talk can take a look at
http://www.yetanother.org/damian/Perl5+i/coroutines.html
for what little we know about perl coroutines at present.)

I like the idea, but I'm not clear on the details.

Let's assume our friendly fibonnacci example.  Assume further that
I create a perltk program with 6 buttons, each of which changes its
label to the return value from fib() when clicked.  The user now
pounds on the buttons in no particular order.

What is the result?
a) Fib_{n} through Fib_{n+5} are on the buttons, in some order.
(There is one continuation context for each coroutine, no matter
how many callers.)

b) Each button displays Fib_{i}, where i is the number of times that
button has been clicked.  (Each caller/coroutine pair gets an
independent continuation context.)

Does it matter if each button's callback had a separate anonymous
subroutine, as opposed to all six using a reference to the same
callback routine?

(If that isn't bad enough, what about threads?  What about Naomi?)

In hopes someone has this straighter in their head than it is in mine...

--kag

Reply via email to