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

Function

Last ( func pred ) -> func las

Optional Arguments

FailanyDetermines what to return in case of failure.

Description

Construct a functional `las(<list> l) -> any' which finds and returns the last element which suffices the predicate function `pred' and returns it.
Note: Apparently `pred' must have `-> elt-alg^boo' out-signature.

Examples

l:=[Random(1000)..1000+Random(1000)]; f:=Last(i->i mod 17=0); l; f(l);

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