[top][index]
search for:

Function \ VisibleList -- apply a function to each member of a list

Synopsis:

  • Operator: \ -- a binary operator
  • Input:
  • an instance of class Function.
  • an instance of class VisibleList.
  • Output:
  • an instance of class VisibleList.
  • f \ w -- apply the function f to each member of the list or sequence w returning a list or sequence containing the results. The same as apply(w,f).

    This operator is right associative, which means that g \ f \ w is interpreted as meaning g \ (f \ w).

    i1 : (j -> j^2) \ (i -> i+1) \ {1,2,3}

    o1 = {4, 9, 16}

    o1 : List

    The precendence is lower than that of @@. Hence, the following two examples yield the same result.

    i2 : sin \ sin \ {1,2,3}

    o2 = {0.745624, 0.789072, 0.140652}

    o2 : List
    i3 : sin @@ sin \ {1,2,3}

    o3 = {0.745624, 0.789072, 0.140652}

    o3 : List

    See also:

  • apply -- apply a function to each element
  • @@ -- a binary operator
  • {...} / Function -- a binary operator, usually used for division
  • Code:

         -- ../../../Macaulay2/m2/classes.m2:68
         Function \ VisibleList := VisibleList => (f,v) -> apply(v,f)

    [top][index]
    search for: