in reply to Collapsing repetitive equality tests: || vs {} vs // (an observation)
You neglected to also look at the any predicate or its overworking cousin grep. Or perhaps Perl 6's any() disjunction or its (forward in history) "backport" any() from Quantum::Superpositions.
my $chr = $_; # Naughty, naughty! You used $_ before but I need it now +. any { $chr eq $_ } qw( a b c ); grep { $chr eq $_ } qw( a b c );
⠤⠤ ⠙⠊⠕⠞⠁⠇⠑⠧⠊
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Collapsing repetitive equality tests: || vs {} vs // (an observation)
by blogical (Pilgrim) on Feb 26, 2007 at 14:54 UTC | |
by rhesa (Vicar) on Feb 26, 2007 at 15:06 UTC | |
by diotalevi (Canon) on Feb 26, 2007 at 20:52 UTC | |
by phaylon (Curate) on Feb 27, 2007 at 15:36 UTC | |
by ikegami (Patriarch) on Feb 27, 2007 at 17:15 UTC |