in reply to Re: Pipe dream
in thread Pipe dream
If you're going to write a grep iterator, have the return value be an empty list on element failure. This allows failures to be removed from the list instead of just being substituted with undefined values. In fact, grep is just a special case of map.
grep /^42/ map { /^42/ ? $_ : () } sub { /^42/ ? $_ : () }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Pipe dream
by Roy Johnson (Monsignor) on Sep 09, 2005 at 18:09 UTC | |
by diotalevi (Canon) on Sep 09, 2005 at 18:10 UTC |