%mathpiper,def="AllSatisfy"

10 # AllSatisfy(pred_IsString,lst_IsList) <-- Apply("And",(MapSingle(pred,lst)));

20 # AllSatisfy(_pred,_lst) <-- False;

%/mathpiper

    %output,preserve="false"
      Result: True
.   %/output


%mathpiper_docs,name="AllSatisfy",categories="User Functions;Predicates"


*CMD AllSatisfy --- Check if all elements of list {lst} satisfy predicate {pred}

*STD
*CALL
	AllSatisfy(pred,lst)

*PARMS

{pred} -- the name of the predicate (as string, with quotes) to be tested

{lst} -- a list


*DESC

The command {AllSatisfy} returns {True} if every element of the list {lst} satisfies the predicate {pred}. 
It returns {False} otherwise.
It also returns {False} if {lst} is not a list, or if {pred} is not a predicate.

*E.G.

In> AllSatisfy("IsInteger",{1,0,-5})
Result> True 
In> AllSatisfy("IsPositiveInteger",{1,0,-5})
Result> False
    
%/mathpiper_docs
