Checks whether the predicate is true for every element combination
(vl-every predicate-function list [list]...)
vl-every function passes the first element of each supplied list as an argument to the test function, followed by the next element from each list, and so on. Evaluation stops as soon as one of the lists runs out.
TheArguments
vl-every, and returns T on any user-specified condition. The predicate-function value can take one of the following forms:
The test function. This can be any function that accepts as many arguments as there are lists provided withA list to be tested.
Return Values
T, if predicate-function returns a non-nil value for every element combination; otherwise nil.
Examples
Check whether there are any empty files in the current directory:
_$ (vl-every
'(lambda (fnm) (> (vl-file-size fnm) 0))
(vl-directory-files nil nil 1) )
T
'<=:
Check whether the list of numbers in NLST is ordered by_$ (setq nlst (list 0 2 pi pi 4))
(0 2 3.14159 3.14159 4)
_$ (vl-every '<= nlst (cdr nlst))
T
Compare the results of the following expressions:
_$ (vl-every '= '(1 2) '(1 3))
nil
_$ (vl-every '= '(1 2) '(1 2 3))
T
nil because vl-every compared the second element in each list and they were not numerically equal. The second expression returned T because vl-every stopped comparing elements after it had processed all the elements in the shorter list (1 2), at which point the lists were numerically equal. If the end of a list is reached, vl-every returns a non-nil value.
The first expression returnedvl-every evaluates one list that contains integer elements and another list that is nil:
The following example demonstrates the result when_$ (setq alist (list 1 2 3 4))
(1 2 3 4)
_$ (setq junk nil)
nil
_$ (vl-every '= junk alist)
T
T because vl-every responds to the nil list as if it has reached the end of the list (even though the predicate hasn't yet been applied to any elements). And since the end of a list has been reached, vl-every returns a non-nil value.
The return value is