comp-decls.red 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404
  1. %
  2. % COMP-DECLS.RED - Machine-independent declaractions used by the compiler
  3. %
  4. % Author: Eric Benson
  5. % Symbolic Computation Group
  6. % Computer Science Dept.
  7. % University of Utah
  8. % Date: 16 October 1981
  9. % Copyright (c) 1981 University of Utah
  10. %
  11. % <PSL.COMP>COMP-DECLS.RED.16, 3-Sep-82 09:46:43, Edit by BENSON
  12. % Added PA1REFORMFN for WNOT
  13. % <PSL.COMP>COMP-DECLS.RED.5, 3-Dec-82 18:20:08, Edit by PERDUE
  14. % Removed PA1REFORMFN for NE
  15. % <PSL.COMP>COMP-DECLS.RED.6, 24-Jan-83 16:04:00, Edit by MLGriss
  16. % Changed W to !%!%!%W in the EQCAR to avoid subst W into EQCAR form
  17. % Pass 1 functions
  18. put('Apply, 'PA1FN, '!&PaApply);
  19. PUT('ASSOC, 'PA1FN, '!&PAASSOC);
  20. PUT('EQUAL, 'PA1FN, '!&PAEQUAL);
  21. PUT('MEMBER, 'PA1FN, '!&PAMEMBER);
  22. put('Catch, 'Pa1Fn, '!&PaCatch);
  23. PUT('COND, 'PA1FN, '!&PACOND);
  24. PUT('DIFFERENCE,'PA1FN, '!&PADIFF);
  25. PUT('FUNCTION, 'PA1FN, '!&PAFUNCTION);
  26. PUT('GETMEM, 'PA1FN, '!&PAGETMEM);
  27. PUT('GO, 'PA1FN, '!&PAIDENT);
  28. PUT('CASE, 'PA1FN, '!&PACASE);
  29. PUT('INTERN, 'PA1FN, '!&PAINTERN);
  30. PUT('LAMBDA, 'PA1FN, '!&PALAMBDA);
  31. PUT('LESSP, 'PA1FN, '!&PALESSP);
  32. PUT('LIST, 'PA1FN, '!&PALIST);
  33. PUT('LOC, 'PA1REFORMFN, '!&REFORMLOC);
  34. PUT('MAP, 'PA1FN, '!&PAMAP);
  35. PUT('MAPC, 'PA1FN, '!&PAMAPC);
  36. PUT('MAPCAN, 'PA1FN, '!&PAMAPCAN);
  37. PUT('MAPCAR, 'PA1FN, '!&PAMAPCAR);
  38. PUT('MAPCON, 'PA1FN, '!&PAMAPCON);
  39. PUT('MAPLIST, 'PA1FN, '!&PAMAPLIST);
  40. PUT('MINUS, 'PA1FN, '!&PAMINUS);
  41. PUT('NULL, 'PA1REFORMFN, '!&REFORMNULL);
  42. % PUT('NE, 'PA1REFORMFN, '!&REFORMNE); % Perdue 12/3/82
  43. put('Nth, 'Pa1Fn, '!&PaNth);
  44. put('PNth, 'Pa1Fn, '!&PaPNth);
  45. PUT('PLUS2, 'PA1FN, '!&PAPLUS2);
  46. PUT('PROG, 'PA1FN, '!&PAPROG);
  47. PUT('PUTMEM, 'PA1FN, '!&PAPUTMEM);
  48. PUT('PUTLISPVAR,'PA1FN, '!&PAPUTLISPVAR);
  49. PUT('LISPVAR, 'PA1FN, '!&PALISPVAR);
  50. PUT('QUOTE, 'PA1FN, '!&PAIDENT);
  51. PUT('WCONST, 'PA1FN, '!&PAWCONST);
  52. PUT('SETQ, 'PA1FN, '!&PASETQ);
  53. PUT('WPLUS2, 'PA1FN, '!&GROUP);
  54. PUT('WDIFFERENCE,'PA1FN, '!&GROUP);
  55. PUT('WMINUS, 'PA1FN, '!&GROUP);
  56. PUT('WTIMES2, 'PA1FN, '!&ASSOCOP);
  57. PUT('WAND, 'PA1FN, '!&ASSOCOP);
  58. PUT('WOR, 'PA1FN, '!&ASSOCOP);
  59. PUT('WXOR, 'PA1FN, '!&ASSOCOP);
  60. PUT('WPLUS2, 'PA1ALGFN, '!&GROUPV);
  61. PUT('WDIFFERENCE,'PA1ALGFN, '!&GROUPV);
  62. PUT('WMINUS, 'PA1ALGFN, '!&GROUPV);
  63. PUT('WTIMES2, 'PA1ALGFN, '!&ASSOCOPV);
  64. PUT('WAND, 'PA1ALGFN, '!&ASSOCOPV);
  65. PUT('WOR, 'PA1ALGFN, '!&ASSOCOPV);
  66. PUT('WXOR, 'PA1ALGFN, '!&ASSOCOPV);
  67. PUT('WSHIFT, 'PA1REFORMFN, '!&DOOP);
  68. PUT('WNOT, 'PA1REFORMFN, '!&DOOP);
  69. put('WTimes2, 'PA1Reformfn, function !&PaReformWTimes2);
  70. % Simplification
  71. PUT('WPLUS2, 'DOFN, 'PLUS2);
  72. PUT('WDIFFERENCE,'DOFN, 'DIFFERENCE);
  73. PUT('WMINUS, 'DOFN, 'MINUS);
  74. PUT('WTIMES2, 'DOFN, 'TIMES2);
  75. PUT('WQUOTIENT, 'DOFN, 'QUOTIENT);
  76. PUT('WREMAINDER,'DOFN, 'REMAINDER);
  77. PUT('WAND, 'DOFN, 'LAND);
  78. PUT('WOR, 'DOFN, 'LOR);
  79. PUT('WXOR, 'DOFN, 'LXOR);
  80. PUT('WNOT, 'DOFN, 'LNOT);
  81. PUT('WSHIFT, 'DOFN, 'LSHIFT);
  82. PUT('WTIMES2, 'ONE, 1);
  83. PUT('WTIMES2, 'ZERO, 0);
  84. PUT('WPLUS2, 'ONE, 0);
  85. PUT('WPLUS2, 'GROUPOPS, '(WPLUS2 WDIFFERENCE WMINUS));
  86. PUT('WMINUS, 'GROUPOPS, '(WPLUS2 WDIFFERENCE WMINUS));
  87. PUT('WDIFFERENCE,'GROUPOPS, '(WPLUS2 WDIFFERENCE WMINUS));
  88. PUT('WAND, 'ZERO, 0);
  89. PUT('WOR, 'ONE, 0);
  90. PUT('WXOR, 'ONE, 0);
  91. % Compile functions
  92. PUT('AND, 'COMPFN, '!&COMANDOR);
  93. PUT('APPLY, 'COMPFN, '!&COMAPPLY);
  94. PUT('COND, 'COMPFN, '!&COMCOND);
  95. PUT('CONS, 'COMPFN, '!&COMCONS);
  96. PUT('GO, 'COMPFN, '!&COMGO);
  97. PUT('CASE, 'COMPFN, '!&COMCASE);
  98. PUT('OR, 'COMPFN, '!&COMANDOR);
  99. PUT('PROG, 'COMPFN, '!&COMPROG);
  100. PUT('PROG2, 'COMPFN, '!&COMPROGN);
  101. PUT('PROGN, 'COMPFN, '!&COMPROGN);
  102. PUT('RETURN, 'COMPFN, '!&COMRETURN);
  103. % Patterns for the tests and SETQ
  104. PUT('EQ, 'OPENTST, '(TSTPAT !*JUMPEQ));
  105. PUT('EQ, 'OPENFN, '(TVPAT !*JUMPEQ));
  106. PUT('NE, 'OPENTST, '(TSTPAT !*JUMPNOTEQ));
  107. PUT('NE, 'OPENFN, '(TVPAT !*JUMPNOTEQ));
  108. PUT('AND, 'OPENTST, '!&TSTANDOR);
  109. PUT('OR, 'OPENTST, '!&TSTANDOR);
  110. PUT('PAIRP, 'OPENTST, '(TSTPAT2 !*JUMPTYPE PAIR));
  111. PUT('ATOM, 'OPENTST, '(TSTPAT2 !*JUMPNOTTYPE PAIR));
  112. PUT('STRINGP, 'OPENTST, '(TSTPAT2 !*JUMPTYPE STR));
  113. PUT('NOTSTRINGP, 'OPENTST, '(TSTPAT2 !*JUMPNOTTYPE STR));
  114. PUT('VECTORP, 'OPENTST, '(TSTPAT2 !*JUMPTYPE VECT));
  115. PUT('NOTVECTORP, 'OPENTST, '(TSTPAT2 !*JUMPNOTTYPE VECT));
  116. PUT('CODEP, 'OPENTST, '(TSTPAT2 !*JUMPTYPE CODE));
  117. PUT('NOTCODEP, 'OPENTST, '(TSTPAT2 !*JUMPNOTTYPE CODE));
  118. PUT('FLOATP, 'OPENTST, '(TSTPAT2 !*JUMPTYPE FLTN));
  119. PUT('NOTFLOATP, 'OPENTST, '(TSTPAT2 !*JUMPNOTTYPE FLTN));
  120. PUT('INTP, 'OPENTST, '(TSTPAT2 !*JUMPINTYPE POSINT));
  121. PUT('NOTINTP, 'OPENTST, '(TSTPAT2 !*JUMPNOTINTYPE POSINT));
  122. PUT('FIXP, 'OPENTST, '(TSTPAT2 !*JUMPINTYPE BIGN));
  123. PUT('NOTFIXP, 'OPENTST, '(TSTPAT2 !*JUMPNOTINTYPE BIGN));
  124. PUT('NUMBERP, 'OPENTST, '(TSTPAT2 !*JUMPINTYPE FLTN));
  125. PUT('NOTNUMBERP,'OPENTST, '(TSTPAT2 !*JUMPNOTINTYPE FLTN));
  126. PUT('FIXNP, 'OPENTST, '(TSTPAT2 !*JUMPTYPE FIXN));
  127. PUT('NOTFIXNP, 'OPENTST, '(TSTPAT2 !*JUMPNOTTYPE FIXN));
  128. PUT('BIGP, 'OPENTST, '(TSTPAT2 !*JUMPTYPE BIGN));
  129. PUT('NOTBIGP, 'OPENTST, '(TSTPAT2 !*JUMPNOTTYPE BIGN));
  130. PUT('POSINTP, 'OPENTST, '(TSTPAT2 !*JUMPTYPE POSINT));
  131. PUT('NOTPOSINTP,'OPENTST, '(TSTPAT2 !*JUMPNOTTYPE POSINT));
  132. PUT('NEGINTP, 'OPENTST, '(TSTPAT2 !*JUMPTYPE NEGINT));
  133. PUT('NOTNEGINTP,'OPENTST, '(TSTPAT2 !*JUMPNOTTYPE NEGINT));
  134. PUT('IDP, 'OPENTST, '(TSTPAT2 !*JUMPTYPE ID));
  135. PUT('NOTIDP, 'OPENTST, '(TSTPAT2 !*JUMPNOTTYPE ID));
  136. PUT('BYTESP, 'OPENTST, '(TSTPAT2 !*JUMPTYPE BYTES));
  137. PUT('NOTBYTESP, 'OPENTST, '(TSTPAT2 !*JUMPNOTTYPE BYTES));
  138. PUT('WRDSP, 'OPENTST, '(TSTPAT2 !*JUMPTYPE WRDS));
  139. PUT('NOTWRDSP, 'OPENTST, '(TSTPAT2 !*JUMPNOTTYPE WRDS));
  140. PUT('HALFWORDSP, 'OPENTST, '(TSTPAT2 !*JUMPTYPE HALFWORDS));
  141. PUT('NOTHALFWORDSP, 'OPENTST, '(TSTPAT2 !*JUMPNOTTYPE HALFWORDS));
  142. PUT('PAIRP, 'OPENFN, '(TVPAT1 !*JUMPTYPE PAIR));
  143. PUT('ATOM, 'OPENFN, '(TVPAT1 !*JUMPNOTTYPE PAIR));
  144. PUT('STRINGP, 'OPENFN, '(TVPAT1 !*JUMPTYPE STR));
  145. PUT('NOTSTRINGP,'OPENFN, '(TVPAT1 !*JUMPNOTTYPE STR));
  146. PUT('VECTORP, 'OPENFN, '(TVPAT1 !*JUMPTYPE VECT));
  147. PUT('NOTVECTORP,'OPENFN, '(TVPAT1 !*JUMPNOTTYPE VECT));
  148. PUT('CODEP, 'OPENFN, '(TVPAT1 !*JUMPTYPE CODE));
  149. PUT('NOTCODEP, 'OPENFN, '(TVPAT1 !*JUMPNOTTYPE CODE));
  150. PUT('FLOATP, 'OPENFN, '(TVPAT1 !*JUMPTYPE FLTN));
  151. PUT('NOTFLOATP, 'OPENFN, '(TVPAT1 !*JUMPNOTTYPE FLTN));
  152. PUT('INTP, 'OPENFN, '(TVPAT1 !*JUMPINTYPE POSINT));
  153. PUT('NOTINTP, 'OPENFN, '(TVPAT1 !*JUMPNOTINTYPE POSINT));
  154. PUT('FIXP, 'OPENFN, '(TVPAT1 !*JUMPINTYPE BIGN));
  155. PUT('NOTFIXP, 'OPENFN, '(TVPAT1 !*JUMPNOTINTYPE BIGN));
  156. PUT('NUMBERP, 'OPENFN, '(TVPAT1 !*JUMPINTYPE FLTN));
  157. PUT('NOTNUMBERP,'OPENFN, '(TVPAT1 !*JUMPNOTINTYPE FLTN));
  158. PUT('FIXNP, 'OPENFN, '(TVPAT1 !*JUMPTYPE FIXN));
  159. PUT('NOTFIXNP, 'OPENFN, '(TVPAT1 !*JUMPNOTTYPE FIXN));
  160. PUT('BIGP, 'OPENFN, '(TVPAT1 !*JUMPTYPE BIGN));
  161. PUT('NOTBIGP, 'OPENFN, '(TVPAT1 !*JUMPNOTTYPE BIGN));
  162. PUT('POSINTP, 'OPENFN, '(TVPAT1 !*JUMPTYPE POSINT));
  163. PUT('NOTPOSINTP,'OPENFN, '(TVPAT1 !*JUMPNOTTYPE POSINT));
  164. PUT('NEGINTP, 'OPENFN, '(TVPAT1 !*JUMPTYPE NEGINT));
  165. PUT('NOTNEGINTP,'OPENFN, '(TVPAT1 !*JUMPNOTTYPE NEGINT));
  166. PUT('IDP, 'OPENFN, '(TVPAT1 !*JUMPTYPE ID));
  167. PUT('NOTIDP, 'OPENFN, '(TVPAT1 !*JUMPNOTTYPE ID));
  168. PUT('BYTESP, 'OPENFN, '(TVPAT1 !*JUMPTYPE BYTES));
  169. PUT('NOTBYTESP, 'OPENFN, '(TVPAT1 !*JUMPNOTTYPE BYTES));
  170. PUT('WRDSP, 'OPENFN, '(TVPAT1 !*JUMPTYPE WRDS));
  171. PUT('NOTWRDSP, 'OPENFN, '(TVPAT1 !*JUMPNOTTYPE WRDS));
  172. PUT('HALFWORDSP, 'OPENFN, '(TVPAT1 !*JUMPTYPE HALFWORDS));
  173. PUT('NOTHALFWORDSP, 'OPENFN, '(TVPAT1 !*JUMPNOTTYPE HALFWORDS));
  174. PUT('SETQ, 'OPENFN, '(SETQPAT NIL));
  175. PUT('RPLACA, 'OPENFN, '(RPLACPAT CAR));
  176. PUT('RPLACD, 'OPENFN, '(RPLACPAT CDR));
  177. PUT('WPLUS2, 'OPENFN, '(ASSOCPAT !*WPLUS2));
  178. PUT('WDIFFERENCE,'OPENFN, '(SUBPAT !*WDIFFERENCE));
  179. PUT('WTIMES2, 'OPENFN, '(ASSOCPAT !*WTIMES2));
  180. PUT('WMINUS, 'OPENFN, '(UNARYPAT !*WMINUS));
  181. PUT('WAND, 'OPENFN, '(ASSOCPAT !*WAND));
  182. PUT('WOR, 'OPENFN, '(ASSOCPAT !*WOR));
  183. PUT('WXOR, 'OPENFN, '(ASSOCPAT !*WXOR));
  184. PUT('WNOT, 'OPENFN, '(UNARYPAT !*WNOT));
  185. PUT('WSHIFT, 'OPENFN, '(NONASSOCPAT !*WSHIFT));
  186. PUT('MKITEMREV, 'OPENFN, '(NONASSOCPAT !*MKITEM));
  187. PUT('LOC, 'OPENFN, '(UNARYPAT !*LOC));
  188. PUT('!*ADDMEM, 'OPENFN, '(MODMEMPAT !*ADDMEM));
  189. PUT('!*MPYMEM, 'OPENFN, '(MODMEMPAT !*MPYMEM));
  190. PUT('FIELD, 'OPENFN, '(FIELDPAT !*FIELD));
  191. PUT('SIGNEDFIELD,'OPENFN, '(FIELDPAT !*SIGNEDFIELD));
  192. PUT('PUTFIELDREV,'OPENFN, '(PUTFIELDPAT !*PUTFIELD));
  193. PUT('WGREATERP,'OPENTST, '(TSTPATC !*JUMPWGREATERP !*JUMPWLESSP));
  194. PUT('WLEQ, 'OPENTST, '(TSTPATC !*JUMPWLEQ !*JUMPWGEQ));
  195. PUT('WGEQ, 'OPENTST, '(TSTPATC !*JUMPWGEQ !*JUMPWLEQ));
  196. PUT('WLESSP, 'OPENTST, '(TSTPATC !*JUMPWLESSP !*JUMPWGREATERP));
  197. PUT('WGREATERP, 'OPENFN, '(TVPAT !*JUMPWGREATERP));
  198. PUT('WLEQ, 'OPENFN, '(TVPAT !*JUMPWLEQ));
  199. PUT('WGEQ, 'OPENFN, '(TVPAT !*JUMPWGEQ));
  200. PUT('WLESSP, 'OPENFN, '(TVPAT !*JUMPWLESSP));
  201. PUT('EQ,'FLIPTST,'NE);
  202. PUT('NE,'FLIPTST,'EQ);
  203. PUT('ATOM,'FLIPTST,'PAIRP);
  204. PUT('PAIRP,'FLIPTST,'ATOM);
  205. PUT('STRINGP,'FLIPTST,'NOTSTRINGP);
  206. PUT('NOTSTRINGP,'FLIPTST,'STRINGP);
  207. PUT('BytesP,'FLIPTST,'NOTBytesP);
  208. PUT('NOTBytesP,'FLIPTST,'BytesP);
  209. PUT('WrdsP,'FLIPTST,'NOTWrdsP);
  210. PUT('NOTWrdsP,'FLIPTST,'WrdsP);
  211. PUT('HalfwordsP,'FLIPTST,'NOTHalfwordsP);
  212. PUT('NOTHalfwordsP,'FLIPTST,'HalfwordsP);
  213. PUT('CODEP,'FLIPTST,'NOTCODEP);
  214. PUT('NOTCODEP, 'FLIPTST,'CODEP);
  215. PUT('IDP,'FLIPTST,'NOTIDP);
  216. PUT('NOTIDP,'FLIPTST,'IDP);
  217. PUT('INTP,'FLIPTST,'NOTINTP);
  218. PUT('NOTINTP,'FLIPTST,'INTP);
  219. PUT('POSINTP,'FLIPTST,'NOTPOSINTP);
  220. PUT('NOTPOSINTP,'FLIPTST,'POSINTP);
  221. PUT('NEGINTP,'FLIPTST,'NOTNEGINTP);
  222. PUT('NOTNEGINTP,'FLIPTST,'NEGINTP);
  223. PUT('FIXP,'FLIPTST,'NOTFIXP);
  224. PUT('NOTFIXP,'FLIPTST,'FIXP);
  225. PUT('NUMBERP,'FLIPTST,'NOTNUMBERP);
  226. PUT('NOTNUMBERP,'FLIPTST,'NUMBERP);
  227. PUT('FIXNP,'FLIPTST,'NOTFIXNP);
  228. PUT('NOTFIXNP,'FLIPTST,'FIXNP);
  229. PUT('FLOATP,'FLIPTST,'NOTFLOATP);
  230. PUT('NOTFLOATP,'FLIPTST,'FLOATP);
  231. PUT('BIGP,'FLIPTST,'NOTBIGP);
  232. PUT('NOTBIGP,'FLIPTST,'BIGP);
  233. PUT('VECTORP,'FLIPTST,'NOTVECTORP);
  234. PUT('NOTVECTORP,'FLIPTST,'VECTORP);
  235. PUT('WLESSP,'FLIPTST,'WGEQ);
  236. PUT('WGEQ,'FLIPTST,'WLESSP);
  237. PUT('WLEQ,'FLIPTST,'WGREATERP);
  238. PUT('WGREATERP,'FLIPTST,'WLEQ);
  239. % Match functions
  240. PUT('ANY,'MATCHFN,'!&ANY);
  241. PUT('VAR,'MATCHFN,'!&VAR);
  242. PUT('REG,'MATCHFN,'!&REGFP);
  243. PUT('DEST,'MATCHFN,'!&DEST);
  244. PUT('USESDEST,'MATCHFN,'!&USESDEST);
  245. PUT('REGN,'MATCHFN,'!&REGN);
  246. PUT('NOTDEST,'MATCHFN,'!&NOTDEST);
  247. PUT('NOTANYREG,'MATCHFN,'!&NOTANYREG);
  248. PUT('MEM,'MATCHFN,'!&MEM);
  249. PUT('ANYREGFN,'MATCHFN,'!&ANYREGFNP);
  250. % Tag properties
  251. FLAG('(!$LOCAL !$GLOBAL !$FLUID QUOTE WCONST IDLOC WVAR
  252. REG LABEL FRAME !*FRAMESIZE IREG),
  253. 'TERMINAL);
  254. FLAG('(!$LOCAL !$GLOBAL !$FLUID WVAR),'VAR);
  255. FLAG('(QUOTE WCONST IDLOC FRAMESIZE),'CONST);
  256. FLAG('(REG),'REG);
  257. FLAG('(!$FLUID !$GLOBAL),'EXTVAR);
  258. FLAG('(CAR CDR !$NAME MEMORY FRAMESIZE), 'ANYREG);
  259. FLAG('(!*ADDMEM !*MPYMEM),'MEMMOD);
  260. % Optimizing functions
  261. PUT('!*LBL, 'OPTFN, '!&LBLOPT);
  262. PUT('!*MOVE, 'OPTFN, '!&STOPT);
  263. PUT('!*JUMP, 'OPTFN, '!&JUMPOPT);
  264. % Things which can be compiled
  265. FLAG('(EXPR FEXPR MACRO NEXPR),'COMPILE);
  266. % Some compiler macros
  267. DEFLIST('((CAAR (LAMBDA (U) (CAR (CAR U))))
  268. (CADR (LAMBDA (U) (CAR (CDR U))))
  269. (CDAR (LAMBDA (U) (CDR (CAR U))))
  270. (CDDR (LAMBDA (U) (CDR (CDR U))))
  271. (CAAAR (LAMBDA (U) (CAR (CAR (CAR U)))))
  272. (CAADR (LAMBDA (U) (CAR (CAR (CDR U)))))
  273. (CADAR (LAMBDA (U) (CAR (CDR (CAR U)))))
  274. (CADDR (LAMBDA (U) (CAR (CDR (CDR U)))))
  275. (CDAAR (LAMBDA (U) (CDR (CAR (CAR U)))))
  276. (CDADR (LAMBDA (U) (CDR (CAR (CDR U)))))
  277. (CDDAR (LAMBDA (U) (CDR (CDR (CAR U)))))
  278. (CDDDR (LAMBDA (U) (CDR (CDR (CDR U)))))
  279. (EQCAR (LAMBDA (U V)
  280. ((LAMBDA (!%!%!%W) (AND (PAIRP !%!%!%W)
  281. (EQ (CAR !%!%!%W) V))) U)))
  282. (CONSTANTP (LAMBDA (U)
  283. ((LAMBDA (V) (NOT (OR (PAIRP V) (IDP V))))
  284. U)))
  285. (WEQ (LAMBDA (U V) (EQ U V)))
  286. (WNEQ (LAMBDA (U V) (NE U V)))
  287. (IPLUS2 (LAMBDA (U V) (WPLUS2 U V)))
  288. (IADD1 (LAMBDA (U) (WPLUS2 U 1)))
  289. (IDIFFERENCE (LAMBDA (U V) (WDIFFERENCE U V)))
  290. (ISUB1 (LAMBDA (U) (WDIFFERENCE U 1)))
  291. (ITIMES2 (LAMBDA (U V) (WTIMES2 U V)))
  292. (IQUOTIENT (LAMBDA (U V) (WQUOTIENT U V)))
  293. (IREMAINDER (LAMBDA (U V) (WREMAINDER U V)))
  294. (IGREATERP (LAMBDA (U V) (WGREATERP U V)))
  295. (ILESSP (LAMBDA (U V) (WLESSP U V)))
  296. (ILEQ (LAMBDA (U V) (WLEQ U V)))
  297. (IGEQ (LAMBDA (U V) (WGEQ U V)))
  298. (ILOR (LAMBDA (U V) (WOR U V)))
  299. (ILSH (LAMBDA (U V) (WSHIFT U V)))
  300. (ILAND (LAMBDA (U V) (WAND U V)))
  301. (ILXOR (LAMBDA (U V) (WXOR U V)))
  302. (IZEROP (LAMBDA (U) (EQ U 0)))
  303. (IONEP (LAMBDA (U) (EQ U 1)))
  304. (IMINUSP (LAMBDA (U) (WLESSP U 0)))
  305. (IMINUS (LAMBDA (U) (WMINUS U)))
  306. (PUTFIELD (LAMBDA (U V W X) (PUTFIELDREV X U V W)))
  307. (MKITEM (LAMBDA (U V) (MKITEMREV V U)))
  308. (NEQ (LAMBDA (U V) (NOT (EQUAL U V))))
  309. (GEQ (LAMBDA (U V) (NOT (LESSP U V))))
  310. (LEQ (LAMBDA (U V) (NOT (GREATERP U V))))
  311. (NOT (LAMBDA (U) (NULL U)))),'CMACRO);
  312. % Macro functions
  313. PUT('A1,'SUBSTFN,'!&ARG1);
  314. PUT('A2,'SUBSTFN,'!&ARG2);
  315. PUT('A3,'SUBSTFN,'!&ARG3);
  316. PUT('A4,'SUBSTFN,'!&ARG4);
  317. PUT('FN,'SUBSTFN,'!&PARAM1);
  318. PUT('MAC,'SUBSTFN,'!&PARAM2);
  319. PUT('P2,'SUBSTFN,'!&PARAM3);
  320. PUT('P3,'SUBSTFN,'!&PARAM4);
  321. PUT('T1,'SUBSTFN,'!&GETTEMP);
  322. PUT('T2,'SUBSTFN,'!&GETTEMP);
  323. PUT('T3,'SUBSTFN,'!&GETTEMP);
  324. PUT('T4,'SUBSTFN,'!&GETTEMP);
  325. PUT('L1,'SUBSTFN,'!&GETTEMPLBL);
  326. PUT('L2,'SUBSTFN,'!&GETTEMPLBL);
  327. PUT('L3,'SUBSTFN,'!&GETTEMPLBL);
  328. PUT('L4,'SUBSTFN,'!&GETTEMPLBL);
  329. % Emit functions
  330. PUT('!*LOAD,'EMITFN,'!&EMITLOAD);
  331. PUT('!*STORE,'EMITFN,'!&EMITSTORE);
  332. PUT('!*JUMP,'EMITFN,'!&EMITJUMP);
  333. PUT('!*LBL,'EMITFN,'!&EMITLBL);
  334. PUT('!*ADDMEM,'EMITFN,'!&EMITMEMMOD);
  335. PUT('!*MPYMEM,'EMITFN,'!&EMITMEMMOD);
  336. PUT('!*ADDMEM, 'UNMEMMOD, '!*WPLUS2);
  337. PUT('!*MPYMEM, 'UNMEMMOD, '!*WTIMES2);
  338. % In memory operations
  339. PUT('WPLUS2,'MEMMODFN,'!*ADDMEM);
  340. PUT('WTIMES2,'MEMMODFN,'!*MPYMEM);
  341. % Flip jump for conditional jump macros
  342. PUT('!*JUMPEQ,'NEGJMP,'!*JUMPNOTEQ);
  343. PUT('!*JUMPNOTEQ,'NEGJMP,'!*JUMPEQ);
  344. PUT('!*JUMPTYPE,'NEGJMP,'!*JUMPNOTTYPE);
  345. PUT('!*JUMPNOTTYPE,'NEGJMP,'!*JUMPTYPE);
  346. PUT('!*JUMPINTYPE,'NEGJMP,'!*JUMPNOTINTYPE);
  347. PUT('!*JUMPNOTINTYPE,'NEGJMP,'!*JUMPINTYPE);
  348. PUT('!*JUMPWEQ,'NEGJMP,'!*JUMPWNEQ);
  349. PUT('!*JUMPWNEQ,'NEGJMP,'!*JUMPWEQ);
  350. PUT('!*JUMPWLESSP,'NEGJMP,'!*JUMPWGEQ);
  351. PUT('!*JUMPWGEQ,'NEGJMP,'!*JUMPWLESSP);
  352. PUT('!*JUMPWLEQ,'NEGJMP,'!*JUMPWGREATERP);
  353. PUT('!*JUMPWGREATERP,'NEGJMP,'!*JUMPWLEQ);
  354. % Assorted other flags
  355. FLAG('(!*JUMP !*LINKE !*EXIT),'TRANSFER);
  356. FLAG('(!*LINK !*LINKE),'UNKNOWNUSE);
  357. PUT('!*LINK, 'EXITING, '!*LINKE);
  358. % Initialize variables
  359. !*MSG := T; % Do print messages
  360. !*INSTALLDESTROY := NIL;
  361. !*USINGDESTROY := T;
  362. !*SHOWDEST := NIL;
  363. !*NOFRAMEFLUID := T;
  364. !*USEREGFLUID := NIL;
  365. !*NOLINKE := NIL; %. Permit LINKE
  366. !*ORD := NIL; %. Dont force ORDER
  367. !*R2I := T; %. Do convert Rec to Iter
  368. GLOBALGENSYM!&:=LIST GENSYM(); % initialize symbol list
  369. MAXNARGS!&:=15;
  370. LASTACTUALREG!& := 5;
  371. END;