home *** CD-ROM | disk | FTP | other *** search
/ Oakland CPM Archive / oakcpm.iso / sigm / vol166 / lisco.pst < prev    next >
Encoding:
Text File  |  1984-04-29  |  1.9 KB  |  82 lines

  1.  
  2. [LISCO.PST]
  3. [Post production scheme to compile LISP into REC]
  4. [20 December 1980]
  5.  
  6. [[
  7. Type a LISP function using {}`s rather than ()`s, and
  8. enclosing the whole function within *...|. End the line
  9. with a carriage return. Use lower case. For example:
  10.  
  11.     *{car {cdr {quote {1 2 3 4 5}}}}|
  12.  
  13. Each new keystroke will show another step of compilation.
  14. ]]
  15.  
  16.  
  17.  
  18. [many spaces are redundant]
  19. (<0>  <1>,<0> <1>)
  20. (<0>{ <1>,<0>{<1>)
  21. (<0> }<1>,<0>}<1>)
  22. (<0>{ }<1>,<0>{}<1>)
  23. ( <0>,<0>)
  24.  
  25. [others are essential]
  26. (<0>*<1>{<2>,<0><1> {*<2>)
  27. (<0>%<1>}<2>,<0><1>} %<2>)
  28. (<0>*<1>,%<0><1>)
  29. (<0>%<1>,#<0><1>)
  30.  
  31. [isolate balancing parentheses]
  32. (<0>:{<1>{<2>}:<3>,<0>{<1>:{<2>}:<3>)
  33. (<0>#:{<1>}:<2>,<0>!<1>!<2>)
  34. (<0>:{<1>}:<2>,<0>[<1>]<2>)
  35. (<0>#{<1>}<2>,<0>#:{<1>}:<2>)
  36. (<0>[<1>,<0>{<1>)
  37. (<0>]<1>,<0>}<1>)
  38. (<0>#<1>,<0><1>)
  39.  
  40. [separate elements of top level]
  41. (<0>&<1>!<2>!<3>,<0><1>!<2>!&<3>)
  42. (<0>&<1>{<2>!<3>,<0>&<1>#{<2>!<3>)
  43. (<0>&<1>,<0><1>)
  44.  
  45. [put markers between top level elements]
  46. (<0>~!<1>!<2>!<3>,<0>^!<1>!^~<2>!<3>)
  47. (<0>~ <1>,<0>~<1>)
  48. (<0>~<1> <2>!<3>,<0>^<1>^~<2>!<3>)
  49. (<0>~!<3>,<0>!<3>)
  50. (<0>~<1>!<3>,<0>^<1>^!<3>)
  51.  
  52. [auxiliary cursors]
  53. (<0>?r!<1>,<0><1>)
  54. (<0>?s!<1>,<0><1>)
  55. (<0>?r<1> <2>!<3>,<0>nLn<1>$S?r<2>!<3>)
  56. (<0>?s<1> <2>!<3>,<0><1>$rmml<1>$S?s<2>!<3>)
  57.  
  58. [always be sure that EVAL gets a balanced expression]
  59. ({<1>|<2>,#{<1>|<2>)
  60.  
  61. [EVAL: compile the primitive LISP forms]
  62. (!{lambda <1>!<2>,!#{lambda <1>!<2>)
  63. (!!lambda {<1>}<2>!<3>!<4>|<5>,<4>{? ?r<1> !}<2>{? ?s<1> !}<3>|<5>)
  64. (!car <1>!<2>|<3>,<1> <2>|@0<3>)
  65. (!cdr <1>!<2>|<3>,<1> <2>|@1<3>)
  66. (!cons <1>!<2>|<3>,<1> <2>|@2<3>)
  67. (!atom <1>!<2>|<3>,<1> <2>|@3<3>)
  68. (!eq <1>!<2>|<3>,<1> <2>|@4<3>)
  69. (!quote <1>!<2>|<3>,<2>|`<1>`<3>)
  70. (!if ^<1>^^<2>^^<3>^!<4>|<5>,<3> {? ;L} <2> {? `T`=} <1> ?x <4>|}<5>)
  71. (!if <1>!<2>,!if ~&<1>!<2>)
  72. (!? <1>!<2>|<3>,<2>|<1><3>)
  73. (!<0> <1>!<2>|<3>,<1> <2>|@<0><3>)
  74. (!<0>!<2>|<3>,<2>|@<0><3>)
  75. (?x <1>|<2>,<1>|{<2>)
  76. (<1> <2>|<3>,<2>|<1>$ryG<3>)
  77.  
  78. [close out the compilation]
  79. (|<1>,{<1>T;})
  80.  
  81. [end]
  82.