TU-Berlin → Inst. f. Mathematik → Algebra und Zahlentheorie → KASH → Documentation → Reference Manual
KASH3 Reference Manual
search    

Function

Last ( func pred, seq() s ) -> any

Optional Arguments

FailanyDetermines what to return in case of failure.

Description

Find the last element which suffices the predicate function `pred' and return it.
Note: Apparently `pred' must have `-> elt-alg^boo' out-signature.

Examples

Last(IsPrime,Sequence([1..100]));
Last(IsOdd,Sequence([2,4,6,8,100]));

Built: Mon Nov 14 21:12:39 UTC 2005 on mack
The KANT Group