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

Function

PositionProperty ( func pred ) -> func pos

Optional Arguments

FailanyDetermines what to return in case of failure.

Description

Construct a functional `pos(<list> l) -> elt-ord^rat' which returns the position of the first element of `l' which suffices the predicate function `pred'.
Return FAILURE if no such element exists in `l'.
Note: Apparently `pred' must have `-> elt-alg^boo' out-signature.

Examples

l:=[Random(1000)..1000+Random(1000)];; f:=PositionProperty(i->i mod 17=0);; l; f(l);
Built: Mon Nov 14 21:12:39 UTC 2005 on mack
The KANT Group