next | previous | forward | backward | up | index | toc

# all(BasicList,Function) -- whether all elements of a list satisfy a specified condition

## Synopsis

• Function: all
• Usage:
all(L,f)
• Inputs:
• L, , or an integer. If an integer is given, then the sequence 0..L-1 is used.
• f, , which returns true or false. If omitted, the identity function is used
• Outputs:
• , true if f returns true when applied to every element of L and false otherwise

## Description

 i1 : all({1,2,3,4}, even) o1 = false i2 : all({2,4,6,8}, even) o2 = true i3 : all{true,true,true} o3 = true i4 : all{true,true,false} o4 = false i5 : all{} o5 = true i6 : all(7, x -> x < 10) o6 = true

## See also

• scan -- apply a function to each element in a list or sequence
• apply -- apply a function to each element
• select -- select from a list, hash table, or string
• any -- whether any elements satisfy a specified condition
• isMember -- test membership in a list or set

## Ways to use this method:

• all(BasicList)
• all(BasicList,Function) -- whether all elements of a list satisfy a specified condition
• all(ZZ,Function)