[next][previous][up][top][index]
search for:

position(VisibleList,Function) -- find first element of a list satisfying a condition

Synopsis:

  • Function: position -- find first element of a list satisfying a condition
  • Input:
  • an instance of class VisibleList.
  • an instance of class Function.
  • Code:

         -- ../../../Macaulay2/m2/structure.m2:13-19
         position(VisibleList,Function) := (v,f) -> (
              ret := null;
              select(
                   1, 
                   apply(#v, i -> (i,v#i)), 
                   (i,x) -> f(x) and (ret = i; true));
              ret)

    [next][previous][up][top][index]
    search for: