I admit up front that at this point I am too lazy to read that thread right now but too impatient to wait with my question till later.
What I wonder is whether this can be used to supersede the rather unintuitive
Obviously one could say my (@dir, @other) = part [ -d, ! -d _ ] readdir DH; but I'd like to avoid the duplication. Maybe the following is possible? my (@dir, @other) = part [ -d, 1 ] readdir DH;my (@dir, @other); push @{ -d ? \@dir : \@other } for readdir DH;
That would work assuming that the second test will only catch elements not already caught by the first one. I'm not sure that would be ideal though - it would limit the use of part to mostly a "catch both grep". On the other hand, if it may copy any element to any number of result lists, that specific use would require redundant tests.
Hmm..
Makeshifts last the longest.
In reply to Re: Perl6: Parting of @Arrayed See
by Aristotle
in thread Perl6: Parting of @Arrayed See
by mojotoad
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |