I don't care about "cool". I care about "useful". Callbacks are fundamentally inflexible (Re: Are you looking at XML processing the right way? (merge)).
Note that turning my iterator into your callback interface is trivial:
sub forDerange(&@) { my $cv= shift @_; my $iter= genDerange( @_ ); my @list; while( @list= $iter->() ) { $cv->( @list ); } }
Try to go the other way. (:
- tye
In reply to Re^2: Derangements iterator (callbacks)
by tye
in thread Derangements iterator
by tye
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |