Benefits of continuation?

Michael Hudson mwh21 at cam.ac.uk
Fri Nov 3 15:57:23 EST 2000


"June Kim" <junaftnoon at nospamplzyahoo.com> writes:

> "Courageous" <jkraska1 at san.rr.com> wrote in message
> news:ar160tcnr3vdocehs12rg7u53tfhjohdhl at 4ax.com...
> >
> > >I think this remark above is very true. Context switches was the very
> > >first brain wave I had. Makes me wonder whether continuation actual ever
> > >will be used directly. Indirect usage ("under-water", hidden, etc.)
> > >seems more likely.
> >
> > Right. You have to understand that they are a very useful
> > mechanism upon which you can build alternate flow-control
> > constructs. I personally use them for context-switching in a
> > simulation I wrote. They are, ah.... VERY VERY FAST.
> >
> 
> Could I have a look at some snippets of examples to
> get the feeling of how it works in reality? It would be
> really nice 'cause reading those rather abstract documents
> gives me only vague images of the castle in the air.

I have an example here:

http://starship.python.net/crew/mwh/hacks/amb.py

and (the same, but more bare-bones) here:

http://starship.python.net/crew/mwh/hacks/short_amb.py

I'd admit to them not being the easiest bits of code in the world to
understand, but if you stare at them long enough they might give you
some idea of the power and flexibility of continuations.

Cheers,
M.

-- 
  If a train station is a place where a train stops, what's a
  workstation?                            -- unknown (to me, at least)



More information about the Python-list mailing list