next
|
previous
|
forward
|
backward
|
up
|
top
|
index
|
toc
|
home
Macaulay2
>
The Macaulay2 language
>
lists and sequences
>
all(BasicList,Function)
all(BasicList,Function) -- whether all elements of a list satisfy a specified condition
Synopsis
Usage:
all(L,f)
Function:
all
Inputs:
L
,
a
basic list
f
,
a
function
, which returns true or false
Outputs:
a
Boolean value
,
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
See also
scan
-- apply a function to each element
apply
-- apply a function to each element
select
-- select from a list, hash table, or string
any
-- whether any elements satisfy a specified condition
member
-- test membership in a list or set