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

| KASH3 Reference Manual

Introduction | Reference Manual | Index

search

### Function

First ( func pred ) -> func fir

### Optional Arguments

Fail | any |  | Determines what to return in case of failure.

### Description

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

### Examples

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

### See also

Last ( func ) -> func

| Built: Mon Nov 14 21:12:39 UTC 2005 on mack