Boost logo

Boost :

From: renej_at_[hidden]
Date: 2003-04-20 16:27:43


>
> Python has a cool feature called generators (stolen from other
> languages) which basically turns a function into an input iterator.
> When the function yields a value instead of returning, that represents
> the value at one position of the iterator. When the function finally
> returns, the iterator is exhausted. This can be a very simple way to
> code up a state machine. See:
> http://mail.python.org/pipermail/python-dev/1999-July/000467.html.

additonally, the possible use in that case of lambda functions as
"co-routines" you see in simulation languages/packages, would make
implementing a discrete event system (e.g. simulation) a "breeze"
(read: a lot easier). See, for example, SimPy.

renej


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk