[top][index]
search for:

apply(ZZ,Function) -- apply function to 0 .. n-1

Synopsis:

  • Function: apply -- apply a function to each element
  • Input:
  • an instance of class ZZ.
  • an instance of class Function.
  • Output:
  • an instance of class List.
  • apply(n,f) -- applies the function f to each integer in the range 0 .. n-1 returning the sequence of results. This is equivalent to apply( toList(0 .. n-1),f).

    i1 : apply(10, i -> i^2)

    o1 = {0, 1, 4, 9, 16, 25, 36, 49, 64, 81}

    o1 : List


    [top][index]
    search for: