Macaulay2 » Documentation
Packages » Macaulay2Doc » The Macaulay2 language » lists and sequences » first
next | previous | forward | backward | up | index | toc

# first -- first element of a list

- Usage:
    `first L`
- Inputs:
  - L, a list, or Sequence
- Outputs:
  - f, a thing, the first element of L

## Description

    i1 : first {a,b,c,d,e}

    o1 = a

    o1 : Symbol

    i2 : first gens(QQ[x,y,z])

    o2 = x

    o2 : QQ[x..z]

## See also

- last -- last element of a list
- take -- take some elements from a list or sequence
- select -- select from a list, hash table, or string
- position -- the first element of a list satisfying a condition
- lists and sequences -- a detailed overview of lists and sequences in Macaulay2

## For the programmer

The object first is a function closure.

The source of this document is in /build/macaulay2-88fgJW/macaulay2-1.25.11+ds/M2/Macaulay2/packages/Macaulay2Doc/functions/first-doc.m2:27:0.