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

VisibleList // Function -- apply a function

Description

The parsing precedence of the operators // and \\ is rather low, which makes them useful for avoiding parentheses. See precedence of operators.

i1 : toList \\ sin \ ( 1 .. 5 )

o1 = {.841471, .909297, .14112, -.756802, -.958924}

o1 : List
i2 : ( 1 .. 5 ) / sin // toList

o2 = {.841471, .909297, .14112, -.756802, -.958924}

o2 : List
i3 : (x -> (x,x)) \ (a,b,c,d)

o3 = ((a, a), (b, b), (c, c), (d, d))

o3 : Sequence
i4 : splice \\ (x -> (x,x)) \ (a,b,c,d)

o4 = (a, a, b, b, c, c, d, d)

o4 : Sequence

See also

Ways to use this method:

  • Thing // Command
  • Thing // Function
  • Thing // SelfInitializingType
  • VisibleList // Command
  • VisibleList // Function -- apply a function

The source of this document is in /build/reproducible-path/macaulay2-1.25.06+ds/M2/Macaulay2/packages/Macaulay2Doc/operators.m2:679:0.