Talk:Hamming numbers: Difference between revisions

Line 158:
|}
The new "Cyclic generator variant #1" version seems to be much, much worse. --[[User:Spoon!|Spoon!]] 20:52, 12 October 2012 (UTC)
 
: The '#1' variant is indeed doing something completely different. Original code's <code>tee()</code> creates multiple copies of a generator, but does this exactly once per <code>raymonds_hamming()</code> call. The '#1' variant is actually recursive: caller calls <code>hamming_number()</code>, which in turn calls <code>tee()</code> and creates copies ... which unfortunately calls <code>hamming_number()</code> again with a new closure, which calles <code>tee()</code> and makes new sets of copies, recursively. Either the author on programmingpraxis site misunderstood how <code>tee()</code> works, or he simply wanted brevity (much) more than efficiency. --[[User:Ledrug|Ledrug]] 03:19, 13 October 2012 (UTC)
Anonymous user