Talk:Generator/Exponential: Difference between revisions

Generators illustrative example
(Generators illustrative example)
Line 27:
 
::: It's named “generator” because that's the name of a particular variation on the theme of coroutines (i.e., ones that go back to their caller while producing a value each time). That the values may be viewed as a sequence is tangential. Generators are interesting particularly because they can implement non-trivial transforms (e.g., where each input value can produce a variable number of output values) which can be hard to express with other approaches. –[[User:Dkf|Donal Fellows]] 14:26, 8 June 2011 (UTC)
:::: Ok, tooting my own horn here a bit, but I put together a nice little Python module for [https://code.google.com/p/dastoobnet/source/browse/multi_m1/filterstack.py using stacked generators] as a filter chain. The docs might be illuminating in this discussion. [http://codepad.org/S7lYcnpO Here's its demo output], on Codepad.--[[User:Short Circuit|Michael Mol]] 15:16, 8 June 2011 (UTC)
 
::: Also, I think "Sequence generator" could be misleading, given that sequences can als be data structures which can be generated without a requirement for mutating state. --[[User:Rdm|Rdm]] 15:01, 8 June 2011 (UTC)