/// <summary> /// <para>Return list, reversed or not, with elements not fulfilling [f] removed. /// Avoid allocation if possible. /// /// </para> /// </summary> public list <T> RevFilterWhenNeeded(Function <T, bool> f) { return((!NList.ForAll <T>(this, f)) ? NList.RevFilter <T>(this, f) : this); }
/// <summary> /// <para>Returns 'true' if all of the 'l' list's elements satisfy /// the condition 'f'. /// /// </para> /// </summary> <remarks><para>Example of use: /// /// </para> <para>NList.ForAll ([2, 4, 6, 8], fun (x) { x % 2 == 0 }) /// /// </para> <para>evaluates to 'true' as all the list's elements are even. /// /// </para></remarks> public bool ForAll(Function <T, bool> f) { return(NList.ForAll <T>(this, f)); }