Macaulay2 » Documentation
Packages » Macaulay2Doc :: Thing // Function
next | previous | forward | backward | up | index | toc

Thing // Function -- apply a function

Synopsis

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: