Don't ask to ask, just ask | |
PerlMonks |
Re^6: Derangements iterator (callbacks)by tye (Sage) |
on Dec 30, 2005 at 19:11 UTC ( [id://520046]=note: print w/replies, xml ) | Need Help?? |
But the iterator already existed. I find it easier to use the iterator to make a callback then to reimplement the algorithm recursively... (: But enough good-natured intentionally talking at cross purposes... I was curious in what order your program produced the derangements and it told me:
So I'll still keep my iterator-from-the-get-go. ;) Update: If this "not too difficult" technique is too difficult for its own creator to correctly apply... And the point still stands that using an iterator via a call-back interface is trivial while using a call-back interface via an interator isn't even possible in stock Perl 5. - tye
In Section
Cool Uses for Perl
|
|