[top][index]
search for:

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

Synopsis:

  • Function: scan -- apply a function to each element
  • Input:
  • an instance of class ZZ.
  • an instance of class Function.
  • Output:
  • an instance of class Nothing.
  • scan(n,f) -- applies the function f to each integer in the range 0 .. n-1 discarding the results.

    This is equivalent to scan(0 .. n-1, f).

    i1 : scan(3,print)
    0
    1
    2
    i2 : v = {a,b,c}

    o2 = {a, b, c}

    o2 : List
    i3 : scan(#v, i -> print(i,v#i))
    (0, a)
    (1, b)
    (2, c)


    [top][index]
    search for: