if (std::any_of(a.begin(), a.end(), [x](auto y) { return y > x; }))
f();
if (count(array_filter($a, function($v) { return $v > $x; })))
f();
// or with intermediate steps
$tmp = array_filter(
$a,
function ($v) { return $v > $x; }
)
if (count($tmp))
f();
// or with array reduce instead
if (
array_reduce($a,
function($old, $item) { return $old or ($item > $x); }
)
)
f();
// Array reduce takes the old result $old, and
// applies $item (from $a) to the old result
// iteratively. We use the 'or' boolean operator
// to implement an 'any' operation.
unsigned i; for (i = 0; i < sizeof(a) / sizeof(a[0]); ++i) { if (a[i] > x) { f(); break; } }
(when (seq (filter #(> % x) a)) (f))
if (std::any_of(a.begin(), a.end(), [x](auto y) { return y > x; })) f();
if (a.Any(e => e > x)) f();
if (a.any((value) => value > x)) f();
if (any(a > x)) call f
for _, v := range a { if v > x { f() break } }
if slices.ContainsFunc(a, func(i int) bool { return i > x }) { f() }
if (a.any { it > x }) f()
when (foldl1 (||) $ map (a > x)) f
if(a.some(item => item > x)){ f() }
for(int i = 0; i<a.length;i++) { if(a[i]>x) { f(); break; } }
if (of(a).anyMatch(i -> i > x)) f();
for (int i : a) if (i > x) { f(); break; }
if (count(array_filter($a, function($v) { return $v > $x; }))) f(); // or with intermediate steps $tmp = array_filter( $a, function ($v) { return $v > $x; } ) if (count($tmp)) f(); // or with array reduce instead if ( array_reduce($a, function($old, $item) { return $old or ($item > $x); } ) ) f(); // Array reduce takes the old result $old, and // applies $item (from $a) to the old result // iteratively. We use the 'or' boolean operator // to implement an 'any' operation.
for v in a do if v > x then f;
f if any { $_ > $x } @a;
if any(z > x for z in a): f()
if any(v > x for v in a): f()
f if a.any?{|v| v > x }
if a.iter().any(|&elem| elem > x) { f() }
(let iter ((l a)) (cond ((null? l) '()) ((> (car l) x) (f)) (else (iter (cdr l)))))