Iterators & generators (RE: Real Problems with Python)

Dan Schmidt dfan at harmonixmusic.com
Tue Feb 15 16:48:14 EST 2000


Harald Hanche-Olsen <hanche at math.ntnu.no> writes:

| + Andrew Cooke <andrew at andrewcooke.free-online.co.uk>:
| 
| | That finally hammered home to me just what continuations are all about.
| | Does anyone have something similarly elegant that shows a coroutine?
| 
| Not me, but let me show you what I learned about it, way back in '73.
| I had the pleasure of learning assembly language programming at the
| feet of a master -- Ole Johan Dahl of Simula fame -- and of course he
| just had to teach us about coroutines and how to do them.  It was
| amazingly simple and powerful.
|
| [explanation snipped]

This is pretty much the same way that Knuth explains coroutines in
volume 1 of The Art of Computer Programming -- which you all have,
right? -- in section 1.4.2.

-- 
Dan Schmidt | http://www.dfan.org



More information about the Python-list mailing list