Recur.html 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. <html lang="en">
  2. <head>
  3. <title>Recur - 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="Recursion.html#Recursion" title="Recursion">
  9. <link rel="prev" href="Recursion.html#Recursion" title="Recursion">
  10. <link rel="next" href="Refer.html#Refer" title="Refer">
  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="Recur"></a>
  28. <p>
  29. Next:&nbsp;<a rel="next" accesskey="n" href="Refer.html#Refer">Refer</a>,
  30. Previous:&nbsp;<a rel="previous" accesskey="p" href="Recursion.html#Recursion">Recursion</a>,
  31. Up:&nbsp;<a rel="up" accesskey="u" href="Recursion.html#Recursion">Recursion</a>
  32. <hr>
  33. </div>
  34. <h5 class="subsubsection">2.7.9.1 Recur</h5>
  35. <p><a name="index-g_t_0040code_007bmeta_007d-298"></a><a name="index-g_t_0040code_007brecur_007d-299"></a>A generalization of the form denoted by <code>meta</code> in <code>silly</code> is
  36. recognized by the virtual machine and allows a slightly more efficient
  37. encoding of recursive applications. An expression <code>recur </code><var>p</var>
  38. has the representation indicated by this theorem,
  39. <dl>
  40. <dt><em>T15</em><dd>[[<code>recur</code>]] <var>p</var> = <code>(((nil,</code><var>p</var><code>),nil),nil)</code>
  41. </dl>
  42. <p class="noindent">which implies that [[<code>meta</code>]] = [[<code>recur</code>]] <code>(nil,nil)</code>.
  43. <p>If <var>p</var> is non-<code>nil</code>, a tree of the form [[<code>recur</code>]]
  44. <var>p</var> is interpreted as follows. Note that <em>P4</em> is
  45. equivalent to the special case of this property for which <var>p</var>
  46. is <code>(nil,nil)</code>.
  47. <dl>
  48. <dt><em>P14</em><dd>([[<code>recur</code>]] <var>p</var>) <var>x</var> = [[<code>meta</code>]] ([[<code>field</code>]] <var>p</var>) <var>x</var>
  49. </dl>
  50. <p>The rationale is that <code>meta</code> would very frequently be composed with
  51. a deconstruction <code>field </code><var>p</var>, so the virtual machine saves some
  52. time and space by allowing the two of them to be encoded in a smaller
  53. tree with the combined meaning.
  54. </body></html>