1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 |
- <html lang="en">
- <head>
- <title>Map - avram - a virtual machine code interpreter</title>
- <meta http-equiv="Content-Type" content="text/html">
- <meta name="description" content="avram - a virtual machine code interpreter">
- <meta name="generator" content="makeinfo 4.13">
- <link title="Top" rel="start" href="index.html#Top">
- <link rel="up" href="List-Combinators.html#List-Combinators" title="List Combinators">
- <link rel="prev" href="List-Combinators.html#List-Combinators" title="List Combinators">
- <link rel="next" href="Filter.html#Filter" title="Filter">
- <link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
- <meta http-equiv="Content-Style-Type" content="text/css">
- <style type="text/css"><!--
- pre.display { font-family:inherit }
- pre.format { font-family:inherit }
- pre.smalldisplay { font-family:inherit; font-size:smaller }
- pre.smallformat { font-family:inherit; font-size:smaller }
- pre.smallexample { font-size:smaller }
- pre.smalllisp { font-size:smaller }
- span.sc { font-variant:small-caps }
- span.roman { font-family:serif; font-weight:normal; }
- span.sansserif { font-family:sans-serif; font-weight:normal; }
- --></style>
- </head>
- <body>
- <div class="node">
- <a name="Map"></a>
- <p>
- Next: <a rel="next" accesskey="n" href="Filter.html#Filter">Filter</a>,
- Previous: <a rel="previous" accesskey="p" href="List-Combinators.html#List-Combinators">List Combinators</a>,
- Up: <a rel="up" accesskey="u" href="List-Combinators.html#List-Combinators">List Combinators</a>
- <hr>
- </div>
- <h5 class="subsubsection">2.7.13.1 Map</h5>
- <p>A virtual code application in the following form causes a function with
- non-<code>nil</code> virtual code <var>f</var> to be applied to every item
- in a list.
- <dl>
- <dt><em>T22</em><dd>[[<code>map</code>]] <var>f</var> = <code>((nil,nil),((nil,</code><var>f</var><code>),nil))</code>
- </dl>
- <p class="noindent"><a name="index-g_t_0040code_007bmap_007d-319"></a>The <code>map</code> mnemonic is used in <code>silly</code> to express applications
- in this form as <code>map </code><var>f</var>. This operation is also well known to
- lisp users and functional programmers. The semantics is determined by
- these two operator properties (for non-<code>nil</code> <var>f</var>).
- <dl>
- <dt><em>P24</em><dd>([[<code>map</code>]] <var>f</var>) <code>nil</code> = <code>nil</code>
- <br><dt><em>P25</em><dd>([[<code>map</code>]] <var>f</var>) <code>(</code><var>x</var><code>,</code><var>y</var><code>)</code> = <code>(</code><var>f</var> <var>x</var><code>,(</code>[[<code>map</code>]] <var>f</var><code>) </code><var>y</var><code>)</code>
- </dl>
- <p class="noindent">Note that the representation of lists described in
- <a href="Representation-of-Numeric-and-Textual-Data.html#Representation-of-Numeric-and-Textual-Data">Representation of Numeric and Textual Data</a>, is assumed.
- </body></html>
|