From: Dennis Ranke Date: 2004-11-15T05:58:22+09:00 Subject: Re: [QUIZ] Countdown (#7) [Solution] Brian Schr�der wrote: > On Mon, 15 Nov 2004 04:08:22 +0900 > Dennis Ranke wrote: >> >>Shouldn't each_term_over call the block for each term when the terms for >>this set of sources was already generated before as well? Now it just >>returns the terms but each_term_over itself just ignore the return >>value. But maybe I just didn't understand the code correctly, after all, >>it appears to work well (although using too much memory on my machine ;) >> > > > each_term_over calls the block once for each unique term it generates. > When a set of terms is already memoized, the block has been called for > each of the terms in the set, so it is not neccessary to call it again. > > This additionally speeds up the process. Oh yes, I misread the source, sorry. Of course each_term_over itself uses the returnvalue, I didn't notice the each the first time I read the source and thought the block was called by the recursive function. Regards, Dennis