Skip to main content
added 209 characters in body
Source Link
rm -rf
  • 89.3k
  • 21
  • 297
  • 479

The Wolfram Language and Mathematica 10 (available now on the Raspberry Pi) have new functions — AnyTrue, AllTrue, NoneTrue — which take a predicate and test any/all/none on the input list. For example:

AnyTrue[Range@5, EvenQ]
(* True *)

AllTrue[{True, False, False}, TrueQ] (* or Identity in place of TrueQ *)
(* False *)

These functions can also be turned into a predicate themselves by using just a test function as a single argument:

NoneTrue[StringQ]@{"a", 1, 23}
(* False *)

The Wolfram Language and Mathematica 10 (available now on the Raspberry Pi) have new functions — AnyTrue, AllTrue, NoneTrue — which take a predicate and test any/all/none on the input list. For example:

AnyTrue[Range@5, EvenQ]
(* True *)

AllTrue[{True, False, False}, TrueQ]
(* False *)

The Wolfram Language and Mathematica 10 (available now on the Raspberry Pi) have new functions — AnyTrue, AllTrue, NoneTrue — which take a predicate and test any/all/none on the input list. For example:

AnyTrue[Range@5, EvenQ]
(* True *)

AllTrue[{True, False, False}, TrueQ] (* or Identity in place of TrueQ *)
(* False *)

These functions can also be turned into a predicate themselves by using just a test function as a single argument:

NoneTrue[StringQ]@{"a", 1, 23}
(* False *)
Source Link
rm -rf
  • 89.3k
  • 21
  • 297
  • 479

The Wolfram Language and Mathematica 10 (available now on the Raspberry Pi) have new functions — AnyTrue, AllTrue, NoneTrue — which take a predicate and test any/all/none on the input list. For example:

AnyTrue[Range@5, EvenQ]
(* True *)

AllTrue[{True, False, False}, TrueQ]
(* False *)