in reply to Re^20: How to completely destroy class attributes with Test::Most?
in thread How to completely destroy class attributes with Test::Most?
For a general-purpose File::Collector, I would expect support for multiple iterators even over the same category. ...
And it just dawned on me: since Iterators are now circular (and presumably the empty string is not a valid file name, although it could be replaced with undef if someone tries this on a platform where it is valid and complains), all you need to support independent iterators for applications that want them is a ->clone method on iterators:
sub clone { my $self = shift; bless [@$self], ref $self; }
And you have made a change that is going to bite your users with infinite loops: the AUTOLOAD for ::Iterator::All should advance the iterator itself: $$self->$method(@_) while ($$self->next); or $$self->method(@) while (defined $$self->next); if you choose to make the end-of-set marker undef instead of an empty string. The method called by invoking ->do should not advance the iterator itself, but only use $self->selected_file.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^22: How to completely destroy class attributes with Test::Most?
by nysus (Parson) on Aug 31, 2019 at 06:49 UTC | |
by jcb (Parson) on Aug 31, 2019 at 21:23 UTC | |
by nysus (Parson) on Sep 07, 2019 at 05:29 UTC | |
by jcb (Parson) on Sep 07, 2019 at 05:42 UTC | |
by nysus (Parson) on Sep 07, 2019 at 13:03 UTC | |
by nysus (Parson) on Sep 07, 2019 at 05:32 UTC | |
by nysus (Parson) on Sep 02, 2019 at 16:59 UTC | |
by nysus (Parson) on Sep 01, 2019 at 23:21 UTC |