Map.html 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. <html lang="en">
  2. <head>
  3. <title>Map - avram - a virtual machine code interpreter</title>
  4. <meta http-equiv="Content-Type" content="text/html">
  5. <meta name="description" content="avram - a virtual machine code interpreter">
  6. <meta name="generator" content="makeinfo 4.13">
  7. <link title="Top" rel="start" href="index.html#Top">
  8. <link rel="up" href="List-Combinators.html#List-Combinators" title="List Combinators">
  9. <link rel="prev" href="List-Combinators.html#List-Combinators" title="List Combinators">
  10. <link rel="next" href="Filter.html#Filter" title="Filter">
  11. <link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
  12. <meta http-equiv="Content-Style-Type" content="text/css">
  13. <style type="text/css"><!--
  14. pre.display { font-family:inherit }
  15. pre.format { font-family:inherit }
  16. pre.smalldisplay { font-family:inherit; font-size:smaller }
  17. pre.smallformat { font-family:inherit; font-size:smaller }
  18. pre.smallexample { font-size:smaller }
  19. pre.smalllisp { font-size:smaller }
  20. span.sc { font-variant:small-caps }
  21. span.roman { font-family:serif; font-weight:normal; }
  22. span.sansserif { font-family:sans-serif; font-weight:normal; }
  23. --></style>
  24. </head>
  25. <body>
  26. <div class="node">
  27. <a name="Map"></a>
  28. <p>
  29. Next:&nbsp;<a rel="next" accesskey="n" href="Filter.html#Filter">Filter</a>,
  30. Previous:&nbsp;<a rel="previous" accesskey="p" href="List-Combinators.html#List-Combinators">List Combinators</a>,
  31. Up:&nbsp;<a rel="up" accesskey="u" href="List-Combinators.html#List-Combinators">List Combinators</a>
  32. <hr>
  33. </div>
  34. <h5 class="subsubsection">2.7.13.1 Map</h5>
  35. <p>A virtual code application in the following form causes a function with
  36. non-<code>nil</code> virtual code <var>f</var> to be applied to every item
  37. in a list.
  38. <dl>
  39. <dt><em>T22</em><dd>[[<code>map</code>]] <var>f</var> = <code>((nil,nil),((nil,</code><var>f</var><code>),nil))</code>
  40. </dl>
  41. <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
  42. in this form as <code>map </code><var>f</var>. This operation is also well known to
  43. lisp users and functional programmers. The semantics is determined by
  44. these two operator properties (for non-<code>nil</code> <var>f</var>).
  45. <dl>
  46. <dt><em>P24</em><dd>([[<code>map</code>]] <var>f</var>) <code>nil</code> = <code>nil</code>
  47. <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>
  48. </dl>
  49. <p class="noindent">Note that the representation of lists described in
  50. <a href="Representation-of-Numeric-and-Textual-Data.html#Representation-of-Numeric-and-Textual-Data">Representation of Numeric and Textual Data</a>, is assumed.
  51. </body></html>