in reply to Re^3: if ... elsif ... else
in thread if ... elsif ... else
... any() can be replaced by grep to obtain the same result.
Insofar as the final result is concerned, I'd agree. The only caveat I'd offer is that for sufficiently large sets of prime factors 2, 3, 5, ..., or of ranges of numbers to be checked, use of a short-circuiting function like any() or none() may offer a noticable performance advantage over grep, which will always process every item in its input list. Of course, this can only be finally determined by benchmarking of some kind.
Give a man a fish: <%-{-{-{-<
|
|---|