Standard-Library.html 3.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. <html lang="en">
  2. <head>
  3. <title>Standard Library - 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="A-Simple-Lisp-Like-Language.html#A-Simple-Lisp-Like-Language" title="A Simple Lisp Like Language">
  9. <link rel="prev" href="Semantics.html#Semantics" title="Semantics">
  10. <link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
  11. <meta http-equiv="Content-Style-Type" content="text/css">
  12. <style type="text/css"><!--
  13. pre.display { font-family:inherit }
  14. pre.format { font-family:inherit }
  15. pre.smalldisplay { font-family:inherit; font-size:smaller }
  16. pre.smallformat { font-family:inherit; font-size:smaller }
  17. pre.smallexample { font-size:smaller }
  18. pre.smalllisp { font-size:smaller }
  19. span.sc { font-variant:small-caps }
  20. span.roman { font-family:serif; font-weight:normal; }
  21. span.sansserif { font-family:sans-serif; font-weight:normal; }
  22. --></style>
  23. </head>
  24. <body>
  25. <div class="node">
  26. <a name="Standard-Library"></a>
  27. <p>
  28. Previous:&nbsp;<a rel="previous" accesskey="p" href="Semantics.html#Semantics">Semantics</a>,
  29. Up:&nbsp;<a rel="up" accesskey="u" href="A-Simple-Lisp-Like-Language.html#A-Simple-Lisp-Like-Language">A Simple Lisp Like Language</a>
  30. <hr>
  31. </div>
  32. <h5 class="subsubsection">2.7.4.3 Standard Library</h5>
  33. <p><code>silly</code> programs may be linked with library modules, which consist
  34. of <code>silly</code> source text to be concatenated with the user
  35. <a name="index-library-modules-259"></a><a name="index-standard-prelude-260"></a>program prior to the preprocessing phase. Most <code>silly</code> programs are
  36. linked with the standard <code>silly</code> prelude, which contains the
  37. following declarations among others.
  38. <a name="index-g_t_0040code_007bnil_007d-261"></a><a name="index-g_t_0040code_007bidentity_007d-262"></a><a name="index-g_t_0040code_007bleft_007d-263"></a><a name="index-g_t_0040code_007bright_007d-264"></a><a name="index-g_t_0040code_007bmeta_007d-265"></a><a name="index-g_t_0040code_007bconstant_007d-266"></a><a name="index-g_t_0040code_007bcouple_007d-267"></a><a name="index-g_t_0040code_007bcompose_007d-268"></a><a name="index-g_t_0040code_007bconditional_007d-269"></a>
  39. <pre class="example">
  40. nil = ()
  41. identity = (nil,(nil,nil))
  42. left = (nil,((nil,nil),nil))
  43. right = (nil,(nil,(nil,nil)))
  44. meta = (((nil,(nil,nil)),nil),nil)
  45. constant_nil = ((nil,nil),nil)
  46. couple = ((((left,nil),constant_nil),nil),right)
  47. compose = couple(identity,constant_nil)
  48. constant = couple(couple(constant_nil,identity),constant_nil)
  49. conditional =
  50. couple(couple(left,compose(left,right)),compose(right,right))
  51. </pre>
  52. <p>There is a close correspondence between these declarations and the
  53. properties described in <a href="A-Minimal-Set-of-Properties.html#A-Minimal-Set-of-Properties">A Minimal Set of Properties</a>. A fitting analogy would be that
  54. the properties of the operator specify the virtual machine instruction
  55. set in a language independent way, and the <code>silly</code> library defines
  56. the instruction mnemonics for a virtual assembly language. The
  57. <a name="index-mnemonics-270"></a>relationship of some mnemonics to their corresponding instructions may
  58. be less clear than that of others, so they are all discussed next.
  59. </body></html>