[top][index]
search for:

take(BasicList,ZZ) -- take some elements from a list

Synopsis:

  • Usage: w = take(v,n)
  • Function: take -- take some elements from a list
  • Input:
  • v, an instance of class BasicList.
  • n, an instance of class ZZ.
  • Output:
  • w, an instance of class BasicList: a list containing the first n elements of the list v if n is positive, or the last -n elements if n is negative.
  • i1 : take({a,b,c,d,e,f},3)

    o1 = {a, b, c}

    o1 : List
    i2 : take({a,b,c,d,e,f},-2)

    o2 = {e, f}

    o2 : List


    [top][index]
    search for: