Re: [code-review] Algorithm::GenerateSequence

Richard Clamp <richardc-PThgL6HeIXdH4x6Dk/[email protected]> Mon, 8 Sep 2003 14:47:47 +0100
Newsgroups gmane.comp.lang.perl.code-review-ladder
Message-ID <[email protected]>
On Mon, Sep 08, 2003 at 11:22:07AM +0200, Steffen M?ller wrote:
> On a more on-topic note: I can't find the original mail, but I suspect 
> that if you used closures instead of OO, you could get some speed-up. 
> (The module *was* OO, right?)

But of course.

The only caveat I have is that I'd have to recast ->reset as something
like:

$iter->('reset');

And then in the closure put a branch in to test/perform it.  As to
whether that's a net win I'd have to benchmark.

Of course I'm not convinced I absolutely need ->reset, so I may just
drop it and return a blessed sub so it can still perform ->as_list.

__ 
Richard Clamp <richardc-PThgL6HeIXdH4x6Dk/[email protected]>