Distribute.html 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. <html lang="en">
  2. <head>
  3. <title>Distribute - 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-Functions.html#List-Functions" title="List Functions">
  9. <link rel="prev" href="Reverse.html#Reverse" title="Reverse">
  10. <link rel="next" href="Transpose.html#Transpose" title="Transpose">
  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="Distribute"></a>
  28. <p>
  29. Next:&nbsp;<a rel="next" accesskey="n" href="Transpose.html#Transpose">Transpose</a>,
  30. Previous:&nbsp;<a rel="previous" accesskey="p" href="Reverse.html#Reverse">Reverse</a>,
  31. Up:&nbsp;<a rel="up" accesskey="u" href="List-Functions.html#List-Functions">List Functions</a>
  32. <hr>
  33. </div>
  34. <h5 class="subsubsection">2.7.14.3 Distribute</h5>
  35. <p>The function with the following virtual code representation is
  36. frequently useful for manipulating lists.
  37. <a name="index-g_t_0040code_007bdistribute_007d-345"></a>
  38. <dl>
  39. <dt><em>T30</em><dd><code>distribute</code> = <code>(((nil,nil),nil),nil)</code>
  40. </dl>
  41. <p class="noindent">This function takes a pair whose right side represents a list, and
  42. returns a list of pairs, with one pair for each item in the list. The
  43. left side of each pair is the left side of the original argument, and
  44. the right side is the corresponding item of the list. A semantics for
  45. this operation is specified by the following properties.
  46. <dl>
  47. <dt><em>P39</em><dd>[[<code>distribute</code>]] <code>(</code><var>x</var><code>,nil)</code> = <code>nil</code>
  48. <br><dt><em>P40</em><dd>[[<code>distribute</code>]] <code>(</code><var>x</var><code>,(</code><var>y</var><code>,</code><var>z</var><code>))</code> =
  49. <code>((</code><var>x</var><code>,</code><var>y</var><code>),</code>[[<code>distribute</code>]] <code>(</code><var>x</var><code>,</code><var>z</var><code>))</code>
  50. </dl>
  51. </body></html>