Talk:Generator/Exponential

From Rosetta Code
Revision as of 17:48, 22 November 2010 by rosettacode>Paddy3118 (→‎"Draft" reasoning: How I fumbled through)

"Draft" reasoning

Draft is mainly because I'm not sure if I have the task right, or that I've done a particularly good job of describing a generator either. IOW, review needed. –Donal Fellows 14:03, 22 November 2010 (UTC)

Hi Donal, I tried to first understand your task description but got nowhere, so converted your Tcl to Python without understanding what it did, then printed the squares, then your filtered sequence to find that it is a list of the squares of positive integers with any that are also cubes of integers taken out. After working that out, your textual description then made perfect sense :-)
That is how it goes for me; sometimes I need the numbers to understand the text. I would wait to see what others think before acting on my tale, but I would suggest the task be formalised as maybe:

1. Create a function returning a generator of the m'th powers of the positive integers starting from zero
2. Use it to create a generator of:
2.1. Squares.
2.2. Cubes.
3. Create a new generator that filters all cubes from the generator of squares.
4. Drop the first 20 values from this last generator of filtered results then show the next 10 values
Note that this tasks requires the use of generators in the calculation of the result.