<?xml version="1.0" encoding="utf-8" ?> <!-- for emacs: -*- coding: utf-8 -*- --> <!-- Apache may like this line in the file .htaccess: AddCharset utf-8 .html --> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1 plus MathML 2.0 plus SVG 1.1//EN" "http://www.w3.org/2002/04/xhtml-math-svg/xhtml-math-svg-flat.dtd" > <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> <head><title>Thing // Function -- apply a function</title> <link rel="stylesheet" type="text/css" href="../../../../Macaulay2/Style/doc.css"/> </head> <body> <table class="buttons"> <tr> <td><div><a href="_throw.html">next</a> | <a href="___Thing.html">previous</a> | <a href="_throw.html">forward</a> | <a href="___Thing.html">backward</a> | up | <a href="index.html">top</a> | <a href="master.html">index</a> | <a href="toc.html">toc</a> | <a href="http://www.math.uiuc.edu/Macaulay2/">Macaulay2 web site</a></div> </td> </tr> </table> <hr/> <div><h1>Thing // Function -- apply a function</h1> <div class="single"><h2>Synopsis</h2> <ul><li><div class="list"><dl class="element"><dt class="heading">Usage: </dt><dd class="value"><div><tt>x // f</tt><br/><tt>f \\ x</tt></div> </dd></dl> </div> </li> <li><span>Operator: <a href="__sl_sl.html" title="a binary operator, usually used for quotient">//</a></span></li> <li><div class="single">Inputs:<ul><li><span><tt>x</tt>, <span>a <a href="___Thing.html">thing</a></span></span></li> <li><span><tt>f</tt>, <span>a <a href="___Function.html">function</a></span>, <span>a <a href="___Command.html">command</a></span>, or <span>a <a href="___Self__Initializing__Type.html">self initializing type</a></span></span></li> </ul> </div> </li> <li><div class="single">Outputs:<ul><li><span><span>a <a href="___Visible__List.html">visible list</a></span>, the result of applying <tt>f</tt> to <tt>x</tt>, i.e., <tt>f x</tt></span></li> </ul> </div> </li> </ul> </div> <div class="single"><h2>Description</h2> <div><p>The parsing precedence of the operators <tt>//</tt> and <tt>\\</tt> is rather low, which makes them useful for avoiding parentheses. See <a href="_precedence_spof_spoperators.html" title="">precedence of operators</a>.</p> <table class="examples"><tr><td><pre>i1 : toList \\ sin \ ( 1 .. 5 ) o1 = {.841471, .909297, .14112, -.756802, -.958924} o1 : List</pre> </td></tr> <tr><td><pre>i2 : ( 1 .. 5 ) / sin // toList o2 = {.841471, .909297, .14112, -.756802, -.958924} o2 : List</pre> </td></tr> <tr><td><pre>i3 : (x -> (x,x)) \ (a,b,c,d) o3 = ((a, a), (b, b), (c, c), (d, d)) o3 : Sequence</pre> </td></tr> <tr><td><pre>i4 : splice \\ (x -> (x,x)) \ (a,b,c,d) o4 = (a, a, b, b, c, c, d, d) o4 : Sequence</pre> </td></tr> </table> </div> </div> <div class="single"><h2>See also</h2> <ul><li><span><a href="___Visible__List_sp_sl_sp__Function.html" title="apply a function to elements of a list">VisibleList / Function</a> -- apply a function to elements of a list</span></li> </ul> </div> </div> </body> </html>