compiler.lsp 157 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767
  1. % RLISP to LISP converter. A C Norman 2002
  2. %
  3. % This code may be used and modified, and redistributed in binary
  4. % or source form, subject to the "CCL Public License", which should
  5. % accompany it. This license is a variant on the BSD license, and thus
  6. % permits use of code derived from this in either open and commercial
  7. % projects: but it does require that updates to this code be made
  8. % available back to the originators of the package.
  9. % Before merging other code in with this or linking this code
  10. % with other packages or libraries please check that the license terms
  11. % of the other material are compatible with those of this.
  12. %
  13. (global (quote (s!:opcodelist)))
  14. (setq s!:opcodelist (quote (LOADLOC LOADLOC0 LOADLOC1 LOADLOC2 LOADLOC3
  15. LOADLOC4 LOADLOC5 LOADLOC6 LOADLOC7 LOADLOC8 LOADLOC9 LOADLOC10 LOADLOC11
  16. LOC0LOC1 LOC1LOC2 LOC2LOC3 LOC1LOC0 LOC2LOC1 LOC3LOC2 VNIL LOADLIT LOADLIT1
  17. LOADLIT2 LOADLIT3 LOADLIT4 LOADLIT5 LOADLIT6 LOADLIT7 LOADFREE LOADFREE1
  18. LOADFREE2 LOADFREE3 LOADFREE4 STORELOC STORELOC0 STORELOC1 STORELOC2
  19. STORELOC3 STORELOC4 STORELOC5 STORELOC6 STORELOC7 STOREFREE STOREFREE1
  20. STOREFREE2 STOREFREE3 LOADLEX STORELEX CLOSURE CARLOC0 CARLOC1 CARLOC2
  21. CARLOC3 CARLOC4 CARLOC5 CARLOC6 CARLOC7 CARLOC8 CARLOC9 CARLOC10 CARLOC11
  22. CDRLOC0 CDRLOC1 CDRLOC2 CDRLOC3 CDRLOC4 CDRLOC5 CAARLOC0 CAARLOC1 CAARLOC2
  23. CAARLOC3 CALL0 CALL1 CALL2 CALL2R CALL3 CALLN CALL0_0 CALL0_1 CALL0_2 CALL0_3
  24. CALL1_0 CALL1_1 CALL1_2 CALL1_3 CALL1_4 CALL1_5 CALL2_0 CALL2_1 CALL2_2
  25. CALL2_3 CALL2_4 BUILTIN0 BUILTIN1 BUILTIN2 BUILTIN2R BUILTIN3 APPLY1 APPLY2
  26. APPLY3 APPLY4 JCALL JCALLN JUMP JUMP_B JUMP_L JUMP_BL JUMPNIL JUMPNIL_B
  27. JUMPNIL_L JUMPNIL_BL JUMPT JUMPT_B JUMPT_L JUMPT_BL JUMPATOM JUMPATOM_B
  28. JUMPATOM_L JUMPATOM_BL JUMPNATOM JUMPNATOM_B JUMPNATOM_L JUMPNATOM_BL JUMPEQ
  29. JUMPEQ_B JUMPEQ_L JUMPEQ_BL JUMPNE JUMPNE_B JUMPNE_L JUMPNE_BL JUMPEQUAL
  30. JUMPEQUAL_B JUMPEQUAL_L JUMPEQUAL_BL JUMPNEQUAL JUMPNEQUAL_B JUMPNEQUAL_L
  31. JUMPNEQUAL_BL JUMPL0NIL JUMPL0T JUMPL1NIL JUMPL1T JUMPL2NIL JUMPL2T JUMPL3NIL
  32. JUMPL3T JUMPL4NIL JUMPL4T JUMPST0NIL JUMPST0T JUMPST1NIL JUMPST1T JUMPST2NIL
  33. JUMPST2T JUMPL0ATOM JUMPL0NATOM JUMPL1ATOM JUMPL1NATOM JUMPL2ATOM
  34. JUMPL2NATOM JUMPL3ATOM JUMPL3NATOM JUMPFREE1NIL JUMPFREE1T JUMPFREE2NIL
  35. JUMPFREE2T JUMPFREE3NIL JUMPFREE3T JUMPFREE4NIL JUMPFREE4T JUMPFREENIL
  36. JUMPFREET JUMPLIT1EQ JUMPLIT1NE JUMPLIT2EQ JUMPLIT2NE JUMPLIT3EQ JUMPLIT3NE
  37. JUMPLIT4EQ JUMPLIT4NE JUMPLITEQ JUMPLITNE JUMPB1NIL JUMPB1T JUMPB2NIL JUMPB2T
  38. JUMPFLAGP JUMPNFLAGP JUMPEQCAR JUMPNEQCAR CATCH CATCH_B CATCH_L CATCH_BL
  39. UNCATCH THROW PROTECT UNPROTECT PVBIND PVRESTORE FREEBIND FREERSTR EXIT
  40. NILEXIT LOC0EXIT LOC1EXIT LOC2EXIT PUSH PUSHNIL PUSHNIL2 PUSHNIL3 PUSHNILS
  41. POP LOSE LOSE2 LOSE3 LOSES SWOP EQ EQCAR EQUAL NUMBERP CAR CDR CAAR CADR CDAR
  42. CDDR CONS NCONS XCONS ACONS LENGTH LIST2 LIST2STAR LIST3 PLUS2 ADD1
  43. DIFFERENCE SUB1 TIMES2 GREATERP LESSP FLAGP GET LITGET GETV QGETV QGETVN
  44. BIGSTACK BIGCALL ICASE FASTGET SPARE1 SPARE2)))
  45. (if (demo!-mode) (progn (setq p s!:opcodelist) (prog (j) (setq j 0) lab1001 (
  46. if (minusp (times 1 (difference 254 j))) (return nil)) (progn (setq n (
  47. random!-number (difference 256 j))) (setq q p) (prog (k) (setq k 1) lab1000 (
  48. if (minusp (times 1 (difference n k))) (return nil)) (setq q (cdr q)) (setq k
  49. (plus k 1)) (go lab1000)) (setq w (car p)) (rplaca p (car q)) (rplaca q w) (
  50. setq p (cdr p))) (setq j (plus j 1)) (go lab1001))))
  51. (prog (n) (setq n 0) (prog (var1003) (setq var1003 s!:opcodelist) lab1002 (if
  52. (null var1003) (return nil)) (prog (v) (setq v (car var1003)) (progn (put v
  53. (quote s!:opcode) n) (setq n (plus n 1)))) (setq var1003 (cdr var1003)) (go
  54. lab1002)) (return (list n (quote opcodes) (quote allocated))))
  55. (setq s!:opcodelist nil)
  56. (de s!:vecof (l) (prog (v n) (setq v (mkvect (sub1 (length l)))) (setq n 0) (
  57. prog (var1005) (setq var1005 l) lab1004 (if (null var1005) (return nil)) (
  58. prog (x) (setq x (car var1005)) (progn (putv v n x) (setq n (plus n 1)))) (
  59. setq var1005 (cdr var1005)) (go lab1004)) (return v)))
  60. (progn (put (quote batchp) (quote s!:builtin0) 0) (put (quote date) (quote
  61. s!:builtin0) 1) (put (quote eject) (quote s!:builtin0) 2) (put (quote error1)
  62. (quote s!:builtin0) 3) (put (quote gctime) (quote s!:builtin0) 4) (put (
  63. quote lposn) (quote s!:builtin0) 6) (put (quote posn) (quote s!:builtin0) 8)
  64. (put (quote read) (quote s!:builtin0) 9) (put (quote readch) (quote
  65. s!:builtin0) 10) (put (quote terpri) (quote s!:builtin0) 11) (put (quote time
  66. ) (quote s!:builtin0) 12) (put (quote tyi) (quote s!:builtin0) 13) (put (
  67. quote load!-spid) (quote s!:builtin0) 14) (put (quote abs) (quote s!:builtin1
  68. ) 0) (put (quote add1) (quote s!:builtin1) 1) (put (quote atan) (quote
  69. s!:builtin1) 2) (put (quote apply0) (quote s!:builtin1) 3) (put (quote atom)
  70. (quote s!:builtin1) 4) (put (quote boundp) (quote s!:builtin1) 5) (put (quote
  71. char!-code) (quote s!:builtin1) 6) (put (quote close) (quote s!:builtin1) 7)
  72. (put (quote codep) (quote s!:builtin1) 8) (put (quote compress) (quote
  73. s!:builtin1) 9) (put (quote constantp) (quote s!:builtin1) 10) (put (quote
  74. digit) (quote s!:builtin1) 11) (put (quote endp) (quote s!:builtin1) 12) (put
  75. (quote eval) (quote s!:builtin1) 13) (put (quote evenp) (quote s!:builtin1)
  76. 14) (put (quote evlis) (quote s!:builtin1) 15) (put (quote explode) (quote
  77. s!:builtin1) 16) (put (quote explode2lc) (quote s!:builtin1) 17) (put (quote
  78. explode2) (quote s!:builtin1) 18) (put (quote explodec) (quote s!:builtin1)
  79. 18) (put (quote fixp) (quote s!:builtin1) 19) (put (quote float) (quote
  80. s!:builtin1) 20) (put (quote floatp) (quote s!:builtin1) 21) (put (quote
  81. symbol!-specialp) (quote s!:builtin1) 22) (put (quote gc) (quote s!:builtin1)
  82. 23) (put (quote gensym1) (quote s!:builtin1) 24) (put (quote getenv) (quote
  83. s!:builtin1) 25) (put (quote symbol!-globalp) (quote s!:builtin1) 26) (put (
  84. quote iadd1) (quote s!:builtin1) 27) (put (quote symbolp) (quote s!:builtin1)
  85. 28) (put (quote iminus) (quote s!:builtin1) 29) (put (quote iminusp) (quote
  86. s!:builtin1) 30) (put (quote indirect) (quote s!:builtin1) 31) (put (quote
  87. integerp) (quote s!:builtin1) 32) (put (quote intern) (quote s!:builtin1) 33)
  88. (put (quote isub1) (quote s!:builtin1) 34) (put (quote length) (quote
  89. s!:builtin1) 35) (put (quote lengthc) (quote s!:builtin1) 36) (put (quote
  90. linelength) (quote s!:builtin1) 37) (put (quote liter) (quote s!:builtin1) 38
  91. ) (put (quote load!-module) (quote s!:builtin1) 39) (put (quote lognot) (
  92. quote s!:builtin1) 40) (put (quote macroexpand) (quote s!:builtin1) 41) (put
  93. (quote macroexpand!-1) (quote s!:builtin1) 42) (put (quote macro!-function) (
  94. quote s!:builtin1) 43) (put (quote make!-bps) (quote s!:builtin1) 44) (put (
  95. quote make!-global) (quote s!:builtin1) 45) (put (quote make!-simple!-string)
  96. (quote s!:builtin1) 46) (put (quote make!-special) (quote s!:builtin1) 47) (
  97. put (quote minus) (quote s!:builtin1) 48) (put (quote minusp) (quote
  98. s!:builtin1) 49) (put (quote mkvect) (quote s!:builtin1) 50) (put (quote
  99. modular!-minus) (quote s!:builtin1) 51) (put (quote modular!-number) (quote
  100. s!:builtin1) 52) (put (quote modular!-reciprocal) (quote s!:builtin1) 53) (
  101. put (quote null) (quote s!:builtin1) 54) (put (quote oddp) (quote s!:builtin1
  102. ) 55) (put (quote onep) (quote s!:builtin1) 56) (put (quote pagelength) (
  103. quote s!:builtin1) 57) (put (quote pairp) (quote s!:builtin1) 58) (put (quote
  104. plist) (quote s!:builtin1) 59) (put (quote plusp) (quote s!:builtin1) 60) (
  105. put (quote prin) (quote s!:builtin1) 61) (put (quote princ) (quote
  106. s!:builtin1) 62) (put (quote print) (quote s!:builtin1) 63) (put (quote
  107. printc) (quote s!:builtin1) 64) (put (quote rational) (quote s!:builtin1) 66)
  108. (put (quote rds) (quote s!:builtin1) 68) (put (quote remd) (quote
  109. s!:builtin1) 69) (put (quote reverse) (quote s!:builtin1) 70) (put (quote
  110. reversip) (quote s!:builtin1) 71) (put (quote seprp) (quote s!:builtin1) 72)
  111. (put (quote set!-small!-modulus) (quote s!:builtin1) 73) (put (quote spaces)
  112. (quote s!:builtin1) 74) (put (quote xtab) (quote s!:builtin1) 74) (put (quote
  113. special!-char) (quote s!:builtin1) 75) (put (quote special!-form!-p) (quote
  114. s!:builtin1) 76) (put (quote spool) (quote s!:builtin1) 77) (put (quote stop)
  115. (quote s!:builtin1) 78) (put (quote stringp) (quote s!:builtin1) 79) (put (
  116. quote sub1) (quote s!:builtin1) 80) (put (quote symbol!-env) (quote
  117. s!:builtin1) 81) (put (quote symbol!-function) (quote s!:builtin1) 82) (put (
  118. quote symbol!-name) (quote s!:builtin1) 83) (put (quote symbol!-value) (quote
  119. s!:builtin1) 84) (put (quote system) (quote s!:builtin1) 85) (put (quote fix
  120. ) (quote s!:builtin1) 86) (put (quote ttab) (quote s!:builtin1) 87) (put (
  121. quote tyo) (quote s!:builtin1) 88) (put (quote remob) (quote s!:builtin1) 89)
  122. (put (quote unmake!-global) (quote s!:builtin1) 90) (put (quote
  123. unmake!-special) (quote s!:builtin1) 91) (put (quote upbv) (quote s!:builtin1
  124. ) 92) (put (quote vectorp) (quote s!:builtin1) 93) (put (quote verbos) (quote
  125. s!:builtin1) 94) (put (quote wrs) (quote s!:builtin1) 95) (put (quote zerop)
  126. (quote s!:builtin1) 96) (put (quote car) (quote s!:builtin1) 97) (put (quote
  127. cdr) (quote s!:builtin1) 98) (put (quote caar) (quote s!:builtin1) 99) (put
  128. (quote cadr) (quote s!:builtin1) 100) (put (quote cdar) (quote s!:builtin1)
  129. 101) (put (quote cddr) (quote s!:builtin1) 102) (put (quote qcar) (quote
  130. s!:builtin1) 103) (put (quote qcdr) (quote s!:builtin1) 104) (put (quote
  131. qcaar) (quote s!:builtin1) 105) (put (quote qcadr) (quote s!:builtin1) 106) (
  132. put (quote qcdar) (quote s!:builtin1) 107) (put (quote qcddr) (quote
  133. s!:builtin1) 108) (put (quote ncons) (quote s!:builtin1) 109) (put (quote
  134. numberp) (quote s!:builtin1) 110) (put (quote is!-spid) (quote s!:builtin1)
  135. 111) (put (quote spid!-to!-nil) (quote s!:builtin1) 112) (put (quote append)
  136. (quote s!:builtin2) 0) (put (quote ash) (quote s!:builtin2) 1) (put (quote
  137. assoc) (quote s!:builtin2) 2) (put (quote assoc!*!*) (quote s!:builtin2) 2) (
  138. put (quote atsoc) (quote s!:builtin2) 3) (put (quote deleq) (quote
  139. s!:builtin2) 4) (put (quote delete) (quote s!:builtin2) 5) (put (quote divide
  140. ) (quote s!:builtin2) 6) (put (quote eqcar) (quote s!:builtin2) 7) (put (
  141. quote eql) (quote s!:builtin2) 8) (put (quote eqn) (quote s!:builtin2) 9) (
  142. put (quote expt) (quote s!:builtin2) 10) (put (quote flag) (quote s!:builtin2
  143. ) 11) (put (quote flagpcar) (quote s!:builtin2) 12) (put (quote gcdn) (quote
  144. s!:builtin2) 13) (put (quote geq) (quote s!:builtin2) 14) (put (quote getv) (
  145. quote s!:builtin2) 15) (put (quote greaterp) (quote s!:builtin2) 16) (put (
  146. quote idifference) (quote s!:builtin2) 17) (put (quote igreaterp) (quote
  147. s!:builtin2) 18) (put (quote ilessp) (quote s!:builtin2) 19) (put (quote imax
  148. ) (quote s!:builtin2) 20) (put (quote imin) (quote s!:builtin2) 21) (put (
  149. quote iplus2) (quote s!:builtin2) 22) (put (quote iquotient) (quote
  150. s!:builtin2) 23) (put (quote iremainder) (quote s!:builtin2) 24) (put (quote
  151. irightshift) (quote s!:builtin2) 25) (put (quote itimes2) (quote s!:builtin2)
  152. 26) (put (quote leq) (quote s!:builtin2) 28) (put (quote lessp) (quote
  153. s!:builtin2) 29) (put (quote max2) (quote s!:builtin2) 31) (put (quote member
  154. ) (quote s!:builtin2) 32) (put (quote member!*!*) (quote s!:builtin2) 32) (
  155. put (quote memq) (quote s!:builtin2) 33) (put (quote min2) (quote s!:builtin2
  156. ) 34) (put (quote mod) (quote s!:builtin2) 35) (put (quote
  157. modular!-difference) (quote s!:builtin2) 36) (put (quote modular!-expt) (
  158. quote s!:builtin2) 37) (put (quote modular!-plus) (quote s!:builtin2) 38) (
  159. put (quote modular!-quotient) (quote s!:builtin2) 39) (put (quote
  160. modular!-times) (quote s!:builtin2) 40) (put (quote nconc) (quote s!:builtin2
  161. ) 41) (put (quote neq) (quote s!:builtin2) 42) (put (quote orderp) (quote
  162. s!:builtin2) 43) (put (quote quotient) (quote s!:builtin2) 44) (put (quote
  163. remainder) (quote s!:builtin2) 45) (put (quote remflag) (quote s!:builtin2)
  164. 46) (put (quote remprop) (quote s!:builtin2) 47) (put (quote rplaca) (quote
  165. s!:builtin2) 48) (put (quote rplacd) (quote s!:builtin2) 49) (put (quote
  166. schar) (quote s!:builtin2) 50) (put (quote set) (quote s!:builtin2) 51) (put
  167. (quote smemq) (quote s!:builtin2) 52) (put (quote subla) (quote s!:builtin2)
  168. 53) (put (quote sublis) (quote s!:builtin2) 54) (put (quote
  169. symbol!-set!-definition) (quote s!:builtin2) 55) (put (quote symbol!-set!-env
  170. ) (quote s!:builtin2) 56) (put (quote times2) (quote s!:builtin2) 57) (put (
  171. quote xcons) (quote s!:builtin2) 58) (put (quote equal) (quote s!:builtin2)
  172. 59) (put (quote eq) (quote s!:builtin2) 60) (put (quote cons) (quote
  173. s!:builtin2) 61) (put (quote list2) (quote s!:builtin2) 62) (put (quote get)
  174. (quote s!:builtin2) 63) (put (quote qgetv) (quote s!:builtin2) 64) (put (
  175. quote flagp) (quote s!:builtin2) 65) (put (quote apply1) (quote s!:builtin2)
  176. 66) (put (quote difference) (quote s!:builtin2) 67) (put (quote plus2) (quote
  177. s!:builtin2) 68) (put (quote times2) (quote s!:builtin2) 69) (put (quote
  178. equalcar) (quote s!:builtin2) 70) (put (quote iequal) (quote s!:builtin2) 71)
  179. (put (quote nreverse) (quote s!:builtin2) 72) (put (quote bps!-putv) (quote
  180. s!:builtin3) 0) (put (quote errorset) (quote s!:builtin3) 1) (put (quote
  181. list2!*) (quote s!:builtin3) 2) (put (quote list3) (quote s!:builtin3) 3) (
  182. put (quote putprop) (quote s!:builtin3) 4) (put (quote putv) (quote
  183. s!:builtin3) 5) (put (quote putv!-char) (quote s!:builtin3) 6) (put (quote
  184. subst) (quote s!:builtin3) 7) (put (quote apply2) (quote s!:builtin3) 8) (put
  185. (quote acons) (quote s!:builtin3) 9) nil)
  186. (de s!:prinhex1 (n) (princ (schar "0123456789abcdef" (logand n 15))))
  187. (de s!:prinhex2 (n) (progn (s!:prinhex1 (truncate n 16)) (s!:prinhex1 n)))
  188. (de s!:prinhex4 (n) (progn (s!:prinhex2 (truncate n 256)) (s!:prinhex2 n)))
  189. (flag (quote (comp plap pgwd pwrds notailcall ord nocompile carcheckflag
  190. savedef carefuleq r2i)) (quote switch))
  191. (if (not (boundp (quote !*comp))) (progn (fluid (quote (!*comp))) (setq
  192. !*comp t)))
  193. (if (not (boundp (quote !*nocompile))) (progn (fluid (quote (!*nocompile))) (
  194. setq !*nocompile nil)))
  195. (if (not (boundp (quote !*plap))) (progn (fluid (quote (!*plap))) (setq
  196. !*plap nil)))
  197. (if (not (boundp (quote !*pgwd))) (progn (fluid (quote (!*pgwd))) (setq
  198. !*pgwd nil)))
  199. (if (not (boundp (quote !*pwrds))) (progn (fluid (quote (!*pwrds))) (setq
  200. !*pwrds t)))
  201. (if (not (boundp (quote !*notailcall))) (progn (fluid (quote (!*notailcall)))
  202. (setq !*notailcall nil)))
  203. (if (not (boundp (quote !*ord))) (progn (fluid (quote (!*ord))) (setq !*ord
  204. nil)))
  205. (if (not (boundp (quote !*savedef))) (progn (fluid (quote (!*savedef))) (setq
  206. !*savedef nil)))
  207. (if (not (boundp (quote !*carcheckflag))) (progn (fluid (quote (
  208. !*carcheckflag))) (setq !*carcheckflag t)))
  209. (if (not (boundp (quote !*carefuleq))) (progn (fluid (quote (!*carefuleq))) (
  210. setq !*carefuleq (or (and (boundp (quote lispsystem!*)) (not (null (member (
  211. quote jlisp) lispsystem!*)))) (and (boundp (quote !*features!*)) (not (null (
  212. member (quote !:jlisp) !*features!*))))))))
  213. (if (not (boundp (quote !*r2i))) (progn (fluid (quote (!*r2i))) (setq !*r2i t
  214. )))
  215. (fluid (quote (s!:current_function s!:current_label s!:current_block
  216. s!:current_size s!:current_procedure s!:other_defs s!:lexical_env
  217. s!:has_closure s!:recent_literals s!:used_lexicals s!:a_reg_values
  218. s!:current_count)))
  219. (de s!:start_procedure (nargs nopts restarg) (progn (setq
  220. s!:current_procedure nil) (setq s!:current_label (gensym)) (setq
  221. s!:a_reg_values nil) (if (or (not (zerop nopts)) restarg) (progn (setq
  222. s!:current_block (list (list (quote OPTARGS) nopts) nopts (list (quote
  223. ARGCOUNT) nargs) nargs)) (setq s!:current_size 2)) (if (greaterp nargs 3) (
  224. progn (setq s!:current_block (list (list (quote ARGCOUNT) nargs) nargs)) (
  225. setq s!:current_size 1)) (progn (setq s!:current_block nil) (setq
  226. s!:current_size 0))))))
  227. (de s!:set_label (x) (progn (if s!:current_label (prog (w) (setq w (cons
  228. s!:current_size s!:current_block)) (prog (var1007) (setq var1007
  229. s!:recent_literals) lab1006 (if (null var1007) (return nil)) (prog (x) (setq
  230. x (car var1007)) (rplaca x w)) (setq var1007 (cdr var1007)) (go lab1006)) (
  231. setq s!:recent_literals nil) (setq s!:current_procedure (cons (cons
  232. s!:current_label (cons (list (quote JUMP) x) w)) s!:current_procedure)) (setq
  233. s!:current_block nil) (setq s!:current_size 0))) (setq s!:current_label x) (
  234. setq s!:a_reg_values nil)))
  235. (de s!:outjump (op lab) (prog (g w) (if (not (flagp op (quote s!:preserves_a)
  236. )) (setq s!:a_reg_values nil)) (if (null s!:current_label) (return nil)) (if
  237. (equal op (quote JUMP)) (setq op (list op lab)) (if (equal op (quote ICASE))
  238. (setq op (cons op lab)) (setq op (list op lab (setq g (gensym)))))) (setq w (
  239. cons s!:current_size s!:current_block)) (prog (var1009) (setq var1009
  240. s!:recent_literals) lab1008 (if (null var1009) (return nil)) (prog (x) (setq
  241. x (car var1009)) (rplaca x w)) (setq var1009 (cdr var1009)) (go lab1008)) (
  242. setq s!:recent_literals nil) (setq s!:current_procedure (cons (cons
  243. s!:current_label (cons op w)) s!:current_procedure)) (setq s!:current_block
  244. nil) (setq s!:current_size 0) (setq s!:current_label g) (return op)))
  245. (de s!:outexit nil (prog (w op) (setq op (quote (EXIT))) (if (null
  246. s!:current_label) (return nil)) (setq w (cons s!:current_size
  247. s!:current_block)) (prog (var1011) (setq var1011 s!:recent_literals) lab1010
  248. (if (null var1011) (return nil)) (prog (x) (setq x (car var1011)) (rplaca x w
  249. )) (setq var1011 (cdr var1011)) (go lab1010)) (setq s!:recent_literals nil) (
  250. setq s!:current_procedure (cons (cons s!:current_label (cons op w))
  251. s!:current_procedure)) (setq s!:current_block nil) (setq s!:current_size 0) (
  252. setq s!:current_label nil)))
  253. (flag (quote (PUSH PUSHNIL PUSHNIL2 PUSHNIL3 LOSE LOSE2 LOSE3 LOSES STORELOC
  254. STORELOC0 STORELOC1 STORELOC2 STORELOC3 STORELOC4 STORELOC5 STORELOC6
  255. STORELOC7 JUMP JUMPT JUMPNIL JUMPEQ JUMPEQUAL JUMPNE JUMPNEQUAL JUMPATOM
  256. JUMPNATOM)) (quote s!:preserves_a))
  257. (de s!:outopcode0 (op doc) (prog nil (if (not (flagp op (quote s!:preserves_a
  258. ))) (setq s!:a_reg_values nil)) (if (null s!:current_label) (return nil)) (
  259. setq s!:current_block (cons op s!:current_block)) (setq s!:current_size (plus
  260. s!:current_size 1)) (if (or !*plap !*pgwd) (setq s!:current_block (cons doc
  261. s!:current_block)))))
  262. (de s!:outopcode1 (op arg doc) (prog nil (if (not (flagp op (quote
  263. s!:preserves_a))) (setq s!:a_reg_values nil)) (if (null s!:current_label) (
  264. return nil)) (setq s!:current_block (cons arg (cons op s!:current_block))) (
  265. setq s!:current_size (plus s!:current_size 2)) (if (or !*plap !*pgwd) (setq
  266. s!:current_block (cons (list op doc) s!:current_block)))))
  267. (deflist (quote ((LOADLIT 1) (LOADFREE 2) (CALL0 2) (CALL1 2) (LITGET 2) (
  268. JUMPLITEQ 2) (JUMPLITNE 2) (JUMPLITEQ!* 2) (JUMPLITNE!* 2) (JUMPFREET 2) (
  269. JUMPFREENIL 2))) (quote s!:short_form_bonus))
  270. (de s!:record_literal (env) (prog (w extra) (setq w (gethash (car
  271. s!:current_block) (car env))) (if (null w) (setq w (cons 0 nil))) (setq extra
  272. (get (cadr s!:current_block) (quote s!:short_form_bonus))) (if (null extra)
  273. (setq extra 10) (setq extra (plus extra 10))) (setq s!:recent_literals (cons
  274. (cons nil s!:current_block) s!:recent_literals)) (puthash (car
  275. s!:current_block) (car env) (cons (plus (car w) extra) (cons (car
  276. s!:recent_literals) (cdr w))))))
  277. (de s!:record_literal_for_jump (x env lab) (prog (w extra) (if (null
  278. s!:current_label) (return nil)) (setq w (gethash (cadr x) (car env))) (if (
  279. null w) (setq w (cons 0 nil))) (setq extra (get (car x) (quote
  280. s!:short_form_bonus))) (if (null extra) (setq extra 10) (setq extra (plus
  281. extra 10))) (setq x (s!:outjump x lab)) (puthash (cadar x) (car env) (cons (
  282. plus (car w) extra) (cons (cons nil x) (cdr w))))))
  283. (de s!:outopcode1lit (op arg env) (prog nil (if (not (flagp op (quote
  284. s!:preserves_a))) (setq s!:a_reg_values nil)) (if (null s!:current_label) (
  285. return nil)) (setq s!:current_block (cons arg (cons op s!:current_block))) (
  286. s!:record_literal env) (setq s!:current_size (plus s!:current_size 2)) (if (
  287. or !*plap !*pgwd) (setq s!:current_block (cons (list op arg) s!:current_block
  288. )))))
  289. (de s!:outopcode2 (op arg1 arg2 doc) (prog nil (if (not (flagp op (quote
  290. s!:preserves_a))) (setq s!:a_reg_values nil)) (if (null s!:current_label) (
  291. return nil)) (setq s!:current_block (cons arg2 (cons arg1 (cons op
  292. s!:current_block)))) (setq s!:current_size (plus s!:current_size 3)) (if (or
  293. !*plap !*pgwd) (setq s!:current_block (cons (cons op doc) s!:current_block)))
  294. ))
  295. (de s!:outopcode2lit (op arg1 arg2 doc env) (prog nil (if (not (flagp op (
  296. quote s!:preserves_a))) (setq s!:a_reg_values nil)) (if (null
  297. s!:current_label) (return nil)) (setq s!:current_block (cons arg1 (cons op
  298. s!:current_block))) (s!:record_literal env) (setq s!:current_block (cons arg2
  299. s!:current_block)) (setq s!:current_size (plus s!:current_size 3)) (if (or
  300. !*plap !*pgwd) (setq s!:current_block (cons (cons op doc) s!:current_block)))
  301. ))
  302. (de s!:outlexref (op arg1 arg2 arg3 doc) (prog (arg4) (if (null
  303. s!:current_label) (return nil)) (if (or (greaterp arg1 255) (greaterp arg2
  304. 255) (greaterp arg3 255)) (progn (if (or (greaterp arg1 2047) (greaterp arg2
  305. 31) (greaterp arg3 2047)) (error "stack frame > 2047 or > 31 deep nesting"))
  306. (setq doc (list op doc)) (setq arg4 (logand arg3 255)) (setq arg3 (plus (
  307. truncate arg3 256) (times 16 (logand arg1 15)))) (if (equal op (quote LOADLEX
  308. )) (setq op (plus 192 arg2)) (setq op (plus 224 arg2))) (setq arg2 (truncate
  309. arg1 16)) (setq arg1 op) (setq op (quote BIGSTACK))) (setq doc (list doc))) (
  310. setq s!:current_block (cons arg3 (cons arg2 (cons arg1 (cons op
  311. s!:current_block))))) (setq s!:current_size (plus s!:current_size 4)) (if
  312. arg4 (progn (setq s!:current_block (cons arg4 s!:current_block)) (setq
  313. s!:current_size (plus s!:current_size 1)))) (if (or !*plap !*pgwd) (setq
  314. s!:current_block (cons (cons op doc) s!:current_block)))))
  315. (put (quote LOADLIT) (quote s!:shortform) (cons (quote (1 . 7)) (s!:vecof (
  316. quote (!- LOADLIT1 LOADLIT2 LOADLIT3 LOADLIT4 LOADLIT5 LOADLIT6 LOADLIT7)))))
  317. (put (quote LOADFREE) (quote s!:shortform) (cons (quote (1 . 4)) (s!:vecof (
  318. quote (!- LOADFREE1 LOADFREE2 LOADFREE3 LOADFREE4)))))
  319. (put (quote STOREFREE) (quote s!:shortform) (cons (quote (1 . 3)) (s!:vecof (
  320. quote (!- STOREFREE1 STOREFREE2 STOREFREE3)))))
  321. (put (quote CALL0) (quote s!:shortform) (cons (quote (0 . 3)) (s!:vecof (
  322. quote (CALL0_0 CALL0_1 CALL0_2 CALL0_3)))))
  323. (put (quote CALL1) (quote s!:shortform) (cons (quote (0 . 5)) (s!:vecof (
  324. quote (CALL1_0 CALL1_1 CALL1_2 CALL1_3 CALL1_4 CALL1_5)))))
  325. (put (quote CALL2) (quote s!:shortform) (cons (quote (0 . 4)) (s!:vecof (
  326. quote (CALL2_0 CALL2_1 CALL2_2 CALL2_3 CALL2_4)))))
  327. (put (quote JUMPFREET) (quote s!:shortform) (cons (quote (1 . 4)) (s!:vecof (
  328. quote (!- JUMPFREE1T JUMPFREE2T JUMPFREE3T JUMPFREE4T)))))
  329. (put (quote JUMPFREENIL) (quote s!:shortform) (cons (quote (1 . 4)) (s!:vecof
  330. (quote (!- JUMPFREE1NIL JUMPFREE2NIL JUMPFREE3NIL JUMPFREE4NIL)))))
  331. (put (quote JUMPLITEQ) (quote s!:shortform) (cons (quote (1 . 4)) (s!:vecof (
  332. quote (!- JUMPLIT1EQ JUMPLIT2EQ JUMPLIT3EQ JUMPLIT4EQ)))))
  333. (put (quote JUMPLITNE) (quote s!:shortform) (cons (quote (1 . 4)) (s!:vecof (
  334. quote (!- JUMPLIT1NE JUMPLIT2NE JUMPLIT3NE JUMPLIT4NE)))))
  335. (put (quote JUMPLITEQ!*) (quote s!:shortform) (get (quote JUMPLITEQ) (quote
  336. s!:shortform)))
  337. (put (quote JUMPLITNE!*) (quote s!:shortform) (get (quote JUMPLITNE) (quote
  338. s!:shortform)))
  339. (put (quote CALL0) (quote s!:longform) 0)
  340. (put (quote CALL1) (quote s!:longform) 16)
  341. (put (quote CALL2) (quote s!:longform) 32)
  342. (put (quote CALL3) (quote s!:longform) 48)
  343. (put (quote CALLN) (quote s!:longform) 64)
  344. (put (quote CALL2R) (quote s!:longform) 80)
  345. (put (quote LOADFREE) (quote s!:longform) 96)
  346. (put (quote STOREFREE) (quote s!:longform) 112)
  347. (put (quote JCALL0) (quote s!:longform) 128)
  348. (put (quote JCALL1) (quote s!:longform) 144)
  349. (put (quote JCALL2) (quote s!:longform) 160)
  350. (put (quote JCALL3) (quote s!:longform) 176)
  351. (put (quote JCALLN) (quote s!:longform) 192)
  352. (put (quote FREEBIND) (quote s!:longform) 208)
  353. (put (quote LITGET) (quote s!:longform) 224)
  354. (put (quote LOADLIT) (quote s!:longform) 240)
  355. (de s!:literal_order (a b) (if (equal (cadr a) (cadr b)) (orderp (car a) (car
  356. b)) (greaterp (cadr a) (cadr b))))
  357. (de s!:resolve_literals (env) (prog (w op opspec n litbytes) (setq w (
  358. hashcontents (car env))) (setq w (sort w (function s!:literal_order))) (setq
  359. n (length w)) (setq litbytes (times 4 n)) (if (greaterp n 4096) (setq w (
  360. s!:too_many_literals w n))) (setq n 0) (prog (var1013) (setq var1013 w)
  361. lab1012 (if (null var1013) (return nil)) (prog (x) (setq x (car var1013)) (
  362. progn (rplaca (cdr x) n) (setq n (plus n 1)))) (setq var1013 (cdr var1013)) (
  363. go lab1012)) (prog (var1017) (setq var1017 w) lab1016 (if (null var1017) (
  364. return nil)) (prog (x) (setq x (car var1017)) (progn (setq n (cadr x)) (prog
  365. (var1015) (setq var1015 (cddr x)) lab1014 (if (null var1015) (return nil)) (
  366. prog (y) (setq y (car var1015)) (progn (if (null (car y)) (progn (setq op (
  367. caadr y)) (setq opspec (get op (quote s!:shortform))) (if (and opspec (leq (
  368. caar opspec) n) (leq n (cdar opspec))) (rplaca (cdr y) (getv (cdr opspec) n))
  369. (rplaca (cdadr y) n))) (progn (setq op (caddr y)) (if (greaterp n 255) (
  370. progn (rplaca (car y) (plus (caar y) 1)) (setq op (plus (get op (quote
  371. s!:longform)) (truncate n 256))) (rplaca (cdr y) (ilogand n 255)) (rplaca (
  372. cddr y) (quote BIGCALL)) (rplacd (cdr y) (cons op (cddr y)))) (if (and (setq
  373. opspec (get op (quote s!:shortform))) (leq (caar opspec) n) (leq n (cdar
  374. opspec))) (progn (rplaca (car y) (difference (caar y) 1)) (rplaca (cdr y) (
  375. getv (cdr opspec) n)) (rplacd (cdr y) (cdddr y))) (rplaca (cdr y) n))))))) (
  376. setq var1015 (cdr var1015)) (go lab1014)))) (setq var1017 (cdr var1017)) (go
  377. lab1016)) (prog (var1019) (setq var1019 w) lab1018 (if (null var1019) (return
  378. nil)) (prog (x) (setq x (car var1019)) (rplacd x (cadr x))) (setq var1019 (
  379. cdr var1019)) (go lab1018)) (rplaca env (cons (reversip w) litbytes))))
  380. (de s!:only_loadlit (l) (if (null l) t (if (null (caar l)) nil (if (not (
  381. eqcar (cddar l) (quote LOADLIT))) nil (s!:only_loadlit (cdr l))))))
  382. (de s!:too_many_literals (w n) (prog (k xvecs l r newrefs uses z1) (setq k 0)
  383. (setq n (plus n 1)) (prog nil lab1020 (if (null (and (greaterp n 4096) (not
  384. (null w)))) (return nil)) (progn (if (and (not (equal (cadar w) 10000000)) (
  385. s!:only_loadlit (cddar w))) (progn (setq l (cons (car w) l)) (setq n (
  386. difference n 1)) (setq k (plus k 1)) (if (equal k 256) (progn (setq xvecs (
  387. cons l xvecs)) (setq l nil) (setq k 0) (setq n (plus n 1))))) (setq r (cons (
  388. car w) r))) (setq w (cdr w))) (go lab1020)) (if (greaterp n 4096) (error
  389. "function uses too many literals (4096 is limit)")) (setq xvecs (cons l xvecs
  390. )) (prog nil lab1021 (if (null r) (return nil)) (progn (setq w (cons (car r)
  391. w)) (setq r (cdr r))) (go lab1021)) (prog (var1027) (setq var1027 xvecs)
  392. lab1026 (if (null var1027) (return nil)) (prog (v) (setq v (car var1027)) (
  393. progn (setq newrefs nil) (setq uses 0) (setq r nil) (setq k 0) (prog (var1025
  394. ) (setq var1025 v) lab1024 (if (null var1025) (return nil)) (prog (q) (setq q
  395. (car var1025)) (progn (prog (var1023) (setq var1023 (cddr q)) lab1022 (if (
  396. null var1023) (return nil)) (prog (z) (setq z (car var1023)) (progn (if (car
  397. z) (rplaca (car z) (plus (caar z) 2))) (setq z1 (cons (quote QGETVN) (cons
  398. nil (cddr z)))) (rplaca (cdr z) k) (rplacd (cdr z) z1) (rplacd z (cdr z1)) (
  399. setq newrefs (cons z newrefs)) (setq uses (plus uses 11)))) (setq var1023 (
  400. cdr var1023)) (go lab1022)) (setq r (cons (car q) r)) (setq k (plus k 1)))) (
  401. setq var1025 (cdr var1025)) (go lab1024)) (setq newrefs (cons uses newrefs))
  402. (setq newrefs (cons (s!:vecof (reversip r)) newrefs)) (setq w (cons newrefs w
  403. )))) (setq var1027 (cdr var1027)) (go lab1026)) (return (sort w (function
  404. s!:literal_order)))))
  405. (fluid (quote (s!:into_c)))
  406. (de s!:endprocedure (name env) (prog (pc labelvals w vec) (s!:outexit) (if
  407. s!:into_c (return (cons s!:current_procedure env))) (s!:resolve_literals env)
  408. (setq s!:current_procedure (s!:tidy_flowgraph s!:current_procedure)) (if (
  409. and (not !*notailcall) (not s!:has_closure)) (setq s!:current_procedure (
  410. s!:try_tailcall s!:current_procedure))) (setq s!:current_procedure (
  411. s!:tidy_exits s!:current_procedure)) (setq labelvals (s!:resolve_labels)) (
  412. setq pc (car labelvals)) (setq labelvals (cdr labelvals)) (setq vec (
  413. make!-bps pc)) (setq pc 0) (if (or !*plap !*pgwd) (progn (terpri) (ttab 23) (
  414. princ "+++ ") (prin name) (princ " +++") (terpri))) (prog (var1029) (setq
  415. var1029 s!:current_procedure) lab1028 (if (null var1029) (return nil)) (prog
  416. (b) (setq b (car var1029)) (progn (if (and (car b) (flagp (car b) (quote
  417. used_label)) (or !*plap !*pgwd)) (progn (ttab 20) (prin (car b)) (princ ":")
  418. (terpri))) (setq pc (s!:plant_basic_block vec pc (reverse (cdddr b)))) (setq
  419. b (cadr b)) (if (and b (not (equal (car b) (quote ICASE))) (cdr b) (cddr b))
  420. (setq b (list (car b) (cadr b)))) (setq pc (s!:plant_exit_code vec pc b
  421. labelvals)))) (setq var1029 (cdr var1029)) (go lab1028)) (if !*pwrds (progn (
  422. if (neq (posn) 0) (terpri)) (princ "+++ ") (prin name) (princ " compiled, ")
  423. (princ pc) (princ " + ") (princ (cdar env)) (princ " bytes") (terpri))) (setq
  424. env (caar env)) (if (null env) (setq w nil) (progn (setq w (mkvect (cdar env
  425. ))) (prog nil lab1030 (if (null env) (return nil)) (progn (putv w (cdar env)
  426. (caar env)) (setq env (cdr env))) (go lab1030)))) (return (cons vec w))))
  427. (de s!:add_pending (lab pend blocks) (prog (w) (if (not (atom lab)) (return (
  428. cons (list (gensym) lab 0) pend))) (setq w (atsoc lab pend)) (if w (return (
  429. cons w (deleq w pend))) (return (cons (atsoc lab blocks) pend)))))
  430. (de s!:invent_exit (x blocks) (prog (w) (setq w blocks) scan (if (null w) (go
  431. not_found) (if (and (eqcar (cadar w) x) (equal (caddar w) 0)) (return (cons
  432. (caar w) blocks)) (setq w (cdr w)))) (go scan) not_found (setq w (gensym)) (
  433. return (cons w (cons (list w (list x) 0) blocks)))))
  434. (de s!:destination_label (lab blocks) (prog (n w x) (setq w (atsoc lab blocks
  435. )) (if (s!:is_lose_and_exit w blocks) (return (quote (EXIT)))) (setq x (cadr
  436. w)) (setq n (caddr w)) (setq w (cdddr w)) (if (neq n 0) (return lab)) (if (or
  437. (null x) (null (cdr x))) (return x) (if (equal (cadr x) lab) (return lab) (
  438. if (null (cddr x)) (return (s!:destination_label (cadr x) blocks)) (return
  439. lab))))))
  440. (de s!:remlose (b) (prog (w) (setq w b) (prog nil lab1031 (if (null (and w (
  441. not (atom (car w))))) (return nil)) (setq w (cdr w)) (go lab1031)) (if (null
  442. w) (return (cons 0 b))) (if (and (numberp (car w)) (eqcar (cdr w) (quote
  443. LOSES))) (setq w (cons 2 (cddr w))) (if (or (equal (car w) (quote LOSE)) (
  444. equal (car w) (quote LOSE2)) (equal (car w) (quote LOSE3))) (setq w (cons 1 (
  445. cdr w))) (return (cons 0 b)))) (setq b (s!:remlose (cdr w))) (return (cons (
  446. plus (car w) (car b)) (cdr b)))))
  447. (put (quote CALL0_0) (quote s!:shortcall) (quote (0 . 0)))
  448. (put (quote CALL0_1) (quote s!:shortcall) (quote (0 . 1)))
  449. (put (quote CALL0_2) (quote s!:shortcall) (quote (0 . 2)))
  450. (put (quote CALL0_3) (quote s!:shortcall) (quote (0 . 3)))
  451. (put (quote CALL1_0) (quote s!:shortcall) (quote (1 . 0)))
  452. (put (quote CALL1_1) (quote s!:shortcall) (quote (1 . 1)))
  453. (put (quote CALL1_2) (quote s!:shortcall) (quote (1 . 2)))
  454. (put (quote CALL1_3) (quote s!:shortcall) (quote (1 . 3)))
  455. (put (quote CALL1_4) (quote s!:shortcall) (quote (1 . 4)))
  456. (put (quote CALL1_5) (quote s!:shortcall) (quote (1 . 5)))
  457. (put (quote CALL2_0) (quote s!:shortcall) (quote (2 . 0)))
  458. (put (quote CALL2_1) (quote s!:shortcall) (quote (2 . 1)))
  459. (put (quote CALL2_2) (quote s!:shortcall) (quote (2 . 2)))
  460. (put (quote CALL2_3) (quote s!:shortcall) (quote (2 . 3)))
  461. (put (quote CALL2_4) (quote s!:shortcall) (quote (2 . 4)))
  462. (de s!:remcall (b) (prog (w p q r s) (prog nil lab1032 (if (null (and b (not
  463. (atom (car b))))) (return nil)) (progn (setq p (car b)) (setq b (cdr b))) (go
  464. lab1032)) (if (null b) (return nil) (if (numberp (car b)) (progn (setq r (
  465. car b)) (setq s 2) (setq b (cdr b)) (if (null b) (return nil) (if (numberp (
  466. car b)) (progn (setq q r) (setq r (car b)) (setq s 3) (setq b (cdr b)) (if (
  467. and b (numberp (setq w (car b))) (eqcar (cdr b) (quote BIGCALL)) (equal (
  468. truncate w 16) 4)) (progn (setq r (plus (times 256 (logand w 15)) r)) (setq s
  469. 4) (setq b (cdr b))) (if (eqcar b (quote BIGCALL)) (progn (setq w (truncate
  470. r 16)) (setq r (plus (times 256 (logand r 15)) q)) (setq q w) (if (equal q 5)
  471. (progn (setq q 2) (setq s (difference s 1)) (setq b (cons (quote BIGCALL) (
  472. cons (quote SWOP) (cdr b)))))) (if (greaterp q 4) (return nil))) (if (not (
  473. eqcar b (quote CALLN))) (return nil))))) (if (equal (car b) (quote CALL0)) (
  474. setq q 0) (if (equal (car b) (quote CALL1)) (setq q 1) (if (equal (car b) (
  475. quote CALL2)) (setq q 2) (if (equal (car b) (quote CALL2R)) (progn (setq q 2)
  476. (setq s (difference s 1)) (setq b (cons (quote CALL2) (cons (quote SWOP) (
  477. cdr b))))) (if (equal (car b) (quote CALL3)) (setq q 3) (return nil)))))))) (
  478. setq b (cdr b))) (if (setq q (get (car b) (quote s!:shortcall))) (progn (setq
  479. r (cdr q)) (setq q (car q)) (setq s 1) (setq b (cdr b))) (return nil)))) (
  480. return (cons p (cons q (cons r (cons s b)))))))
  481. (de s!:is_lose_and_exit (b blocks) (prog (lab exit) (setq lab (car b)) (setq
  482. exit (cadr b)) (setq b (cdddr b)) (if (null exit) (return nil)) (setq b (
  483. s!:remlose b)) (setq b (cdr b)) (prog nil lab1033 (if (null (and b (not (atom
  484. (car b))))) (return nil)) (setq b (cdr b)) (go lab1033)) (if b (return nil)
  485. (if (equal (car exit) (quote EXIT)) (return t) (if (equal (car exit) (quote
  486. JUMP)) (progn (if (equal (cadr exit) lab) nil (return (s!:is_lose_and_exit (
  487. atsoc (cadr exit) blocks) blocks)))) (return nil))))))
  488. (de s!:try_tail_1 (b blocks) (prog (exit size body w w0 w1 w2 op) (setq exit
  489. (cadr b)) (if (null exit) (return b) (if (not (equal (car exit) (quote EXIT))
  490. ) (progn (if (equal (car exit) (quote JUMP)) (progn (if (not (
  491. s!:is_lose_and_exit (atsoc (cadr exit) blocks) blocks)) (return b))) (return
  492. b))))) (setq size (caddr b)) (setq body (cdddr b)) (setq body (s!:remlose
  493. body)) (setq size (difference size (car body))) (setq body (cdr body)) (setq
  494. w (s!:remcall body)) (if (null w) (return b)) (setq w0 (cadr w)) (setq w1 (
  495. caddr w)) (setq body (cddddr w)) (if (and (leq w0 7) (leq w1 31)) (progn (
  496. setq body (cons (quote JCALL) body)) (setq body (cons (plus (times 32 w0) w1)
  497. body)) (setq size (difference size 1))) (if (lessp w1 256) (setq body (cons
  498. w0 (cons w1 (cons (quote JCALLN) body)))) (progn (setq body (cons (quote
  499. BIGCALL) body)) (setq w2 (logand w1 255)) (setq w1 (truncate w1 256)) (if (
  500. lessp w0 4) (setq body (cons w2 (cons (plus w1 (times 16 w0) 128) body))) (
  501. progn (setq body (cons w0 (cons w2 (cons (plus w1 (plus (times 16 4) 128))
  502. body)))) (setq size (plus size 1))))))) (if (car w) (setq body (cons (append
  503. (car w) (list (quote TAIL))) body))) (rplaca (cdr b) nil) (rplaca (cddr b) (
  504. plus (difference size (cadddr w)) 3)) (rplacd (cddr b) body) (return b)))
  505. (de s!:try_tailcall (b) (prog (var1035 var1036) (setq var1035 b) lab1034 (if
  506. (null var1035) (return (reversip var1036))) (prog (v) (setq v (car var1035))
  507. (setq var1036 (cons (s!:try_tail_1 v b) var1036))) (setq var1035 (cdr var1035
  508. )) (go lab1034)))
  509. (de s!:tidy_exits_1 (b blocks) (prog (exit size body comm w w0 w1 w2 op) (
  510. setq exit (cadr b)) (if (null exit) (return b) (if (not (equal (car exit) (
  511. quote EXIT))) (progn (if (equal (car exit) (quote JUMP)) (progn (if (not (
  512. s!:is_lose_and_exit (atsoc (cadr exit) blocks) blocks)) (return b))) (return
  513. b))))) (setq size (caddr b)) (setq body (cdddr b)) (setq body (s!:remlose
  514. body)) (setq size (difference size (car body))) (setq body (cdr body)) (prog
  515. nil lab1037 (if (null (and body (not (atom (car body))))) (return nil)) (
  516. progn (setq comm (car body)) (setq body (cdr body))) (go lab1037)) (if (eqcar
  517. body (quote VNIL)) (setq w (quote NILEXIT)) (if (eqcar body (quote LOADLOC0)
  518. ) (setq w (quote LOC0EXIT)) (if (eqcar body (quote LOADLOC1)) (setq w (quote
  519. LOC1EXIT)) (if (eqcar body (quote LOADLOC2)) (setq w (quote LOC2EXIT)) (setq
  520. w nil))))) (if w (progn (rplaca (cdr b) (list w)) (setq body (cdr body)) (
  521. setq size (difference size 1))) (if comm (setq body (cons comm body)))) (
  522. rplaca (cddr b) size) (rplacd (cddr b) body) (return b)))
  523. (de s!:tidy_exits (b) (prog (var1039 var1040) (setq var1039 b) lab1038 (if (
  524. null var1039) (return (reversip var1040))) (prog (v) (setq v (car var1039)) (
  525. setq var1040 (cons (s!:tidy_exits_1 v b) var1040))) (setq var1039 (cdr
  526. var1039)) (go lab1038)))
  527. (de s!:tidy_flowgraph (b) (prog (r pending) (setq b (reverse b)) (setq
  528. pending (list (car b))) (prog nil lab1042 (if (null pending) (return nil)) (
  529. prog (c x l1 l2 done1 done2) (setq c (car pending)) (setq pending (cdr
  530. pending)) (flag (list (car c)) (quote coded)) (setq x (cadr c)) (if (or (null
  531. x) (null (cdr x))) (setq r (cons c r)) (if (equal (car x) (quote ICASE)) (
  532. progn (rplacd x (reversip (cdr x))) (prog (ll) (setq ll (cdr x)) lab1041 (if
  533. (null ll) (return nil)) (progn (setq l1 (s!:destination_label (car ll) b)) (
  534. if (not (atom l1)) (progn (setq l1 (s!:invent_exit (car l1) b)) (setq b (cdr
  535. l1)) (setq l1 (cadr l1)))) (rplaca ll l1) (setq done1 (flagp l1 (quote coded)
  536. )) (flag (list l1) (quote used_label)) (if (not done1) (setq pending (
  537. s!:add_pending l1 pending b)))) (setq ll (cdr ll)) (go lab1041)) (rplacd x (
  538. reversip (cdr x))) (setq r (cons c r))) (if (null (cddr x)) (progn (setq l1 (
  539. s!:destination_label (cadr x) b)) (if (not (atom l1)) (setq c (cons (car c) (
  540. cons l1 (cddr c)))) (if (flagp l1 (quote coded)) (progn (flag (list l1) (
  541. quote used_label)) (setq c (cons (car c) (cons (list (car x) l1) (cddr c)))))
  542. (progn (setq c (cons (car c) (cons nil (cddr c)))) (setq pending (
  543. s!:add_pending l1 pending b))))) (setq r (cons c r))) (progn (setq l1 (
  544. s!:destination_label (cadr x) b)) (setq l2 (s!:destination_label (caddr x) b)
  545. ) (setq done1 (and (atom l1) (flagp l1 (quote coded)))) (setq done2 (and (
  546. atom l2) (flagp l2 (quote coded)))) (if done1 (progn (if done2 (progn (flag (
  547. list l1) (quote used_label)) (rplaca (cdadr c) l1) (setq pending (cons (list
  548. (gensym) (list (quote JUMP) l2) 0) pending))) (progn (flag (list l1) (quote
  549. used_label)) (rplaca (cdadr c) l1) (setq pending (s!:add_pending l2 pending b
  550. ))))) (progn (if done2 (progn (flag (list l2) (quote used_label)) (rplaca (
  551. cadr c) (s!:negate_jump (car x))) (rplaca (cdadr c) l2) (setq pending (
  552. s!:add_pending l1 pending b))) (progn (if (not (atom l1)) (progn (setq l1 (
  553. s!:invent_exit (car l1) b)) (setq b (cdr l1)) (setq l1 (car l1)))) (flag (
  554. list l1) (quote used_label)) (rplaca (cdadr c) l1) (if (not (flagp l1 (quote
  555. coded))) (setq pending (s!:add_pending l1 pending b))) (setq pending (
  556. s!:add_pending l2 pending b)))))) (setq r (cons c r))))))) (go lab1042)) (
  557. return (reverse r))))
  558. (deflist (quote ((JUMPNIL JUMPT) (JUMPT JUMPNIL) (JUMPATOM JUMPNATOM) (
  559. JUMPNATOM JUMPATOM) (JUMPEQ JUMPNE) (JUMPNE JUMPEQ) (JUMPEQUAL JUMPNEQUAL) (
  560. JUMPNEQUAL JUMPEQUAL) (JUMPL0NIL JUMPL0T) (JUMPL0T JUMPL0NIL) (JUMPL1NIL
  561. JUMPL1T) (JUMPL1T JUMPL1NIL) (JUMPL2NIL JUMPL2T) (JUMPL2T JUMPL2NIL) (
  562. JUMPL3NIL JUMPL3T) (JUMPL3T JUMPL3NIL) (JUMPL4NIL JUMPL4T) (JUMPL4T JUMPL4NIL
  563. ) (JUMPL0ATOM JUMPL0NATOM) (JUMPL0NATOM JUMPL0ATOM) (JUMPL1ATOM JUMPL1NATOM)
  564. (JUMPL1NATOM JUMPL1ATOM) (JUMPL2ATOM JUMPL2NATOM) (JUMPL2NATOM JUMPL2ATOM) (
  565. JUMPL3ATOM JUMPL3NATOM) (JUMPL3NATOM JUMPL3ATOM) (JUMPST0NIL JUMPST0T) (
  566. JUMPST0T JUMPST0NIL) (JUMPST1NIL JUMPST1T) (JUMPST1T JUMPST1NIL) (JUMPST2NIL
  567. JUMPST2T) (JUMPST2T JUMPST2NIL) (JUMPFREE1NIL JUMPFREE1T) (JUMPFREE1T
  568. JUMPFREE1NIL) (JUMPFREE2NIL JUMPFREE2T) (JUMPFREE2T JUMPFREE2NIL) (
  569. JUMPFREE3NIL JUMPFREE3T) (JUMPFREE3T JUMPFREE3NIL) (JUMPFREE4NIL JUMPFREE4T)
  570. (JUMPFREE4T JUMPFREE4NIL) (JUMPFREENIL JUMPFREET) (JUMPFREET JUMPFREENIL) (
  571. JUMPLIT1EQ JUMPLIT1NE) (JUMPLIT1NE JUMPLIT1EQ) (JUMPLIT2EQ JUMPLIT2NE) (
  572. JUMPLIT2NE JUMPLIT2EQ) (JUMPLIT3EQ JUMPLIT3NE) (JUMPLIT3NE JUMPLIT3EQ) (
  573. JUMPLIT4EQ JUMPLIT4NE) (JUMPLIT4NE JUMPLIT4EQ) (JUMPLITEQ JUMPLITNE) (
  574. JUMPLITNE JUMPLITEQ) (JUMPLITEQ!* JUMPLITNE!*) (JUMPLITNE!* JUMPLITEQ!*) (
  575. JUMPB1NIL JUMPB1T) (JUMPB1T JUMPB1NIL) (JUMPB2NIL JUMPB2T) (JUMPB2T JUMPB2NIL
  576. ) (JUMPFLAGP JUMPNFLAGP) (JUMPNFLAGP JUMPFLAGP) (JUMPEQCAR JUMPNEQCAR) (
  577. JUMPNEQCAR JUMPEQCAR))) (quote negjump))
  578. (de s!:negate_jump (x) (if (atom x) (get x (quote negjump)) (rplaca x (get (
  579. car x) (quote negjump)))))
  580. (de s!:resolve_labels nil (prog (w labelvals converged pc x) (prog nil
  581. lab1045 (progn (setq converged t) (setq pc 0) (prog (var1044) (setq var1044
  582. s!:current_procedure) lab1043 (if (null var1044) (return nil)) (prog (b) (
  583. setq b (car var1044)) (progn (setq w (assoc!*!* (car b) labelvals)) (if (null
  584. w) (progn (setq converged nil) (setq w (cons (car b) pc)) (setq labelvals (
  585. cons w labelvals))) (if (neq (cdr w) pc) (progn (rplacd w pc) (setq converged
  586. nil)))) (setq pc (plus pc (caddr b))) (setq x (cadr b)) (if (null x) nil (if
  587. (null (cdr x)) (setq pc (plus pc 1)) (if (equal (car x) (quote ICASE)) (setq
  588. pc (plus pc (times 2 (length x)))) (progn (setq w (assoc!*!* (cadr x)
  589. labelvals)) (if (null w) (progn (setq w 128) (setq converged nil)) (setq w (
  590. difference (cdr w) pc))) (setq w (s!:expand_jump (car x) w)) (setq pc (plus
  591. pc (length w))))))))) (setq var1044 (cdr var1044)) (go lab1043))) (if (null
  592. converged) (go lab1045))) (return (cons pc labelvals))))
  593. (de s!:plant_basic_block (vec pc b) (prog (tagged) (prog (var1049) (setq
  594. var1049 b) lab1048 (if (null var1049) (return nil)) (prog (i) (setq i (car
  595. var1049)) (progn (if (atom i) (progn (if (symbolp i) (setq i (get i (quote
  596. s!:opcode)))) (if (and (not tagged) (or !*plap !*pgwd)) (progn (s!:prinhex4
  597. pc) (princ ":") (ttab 8) (setq tagged t))) (if (or (not (fixp i)) (lessp i 0)
  598. (greaterp i 255)) (error "bad byte to put" i)) (bps!-putv vec pc i) (if (or
  599. !*plap !*pgwd) (progn (s!:prinhex2 i) (princ " "))) (setq pc (plus pc 1))) (
  600. if (or !*plap !*pgwd) (progn (ttab 23) (princ (car i)) (prog (var1047) (setq
  601. var1047 (cdr i)) lab1046 (if (null var1047) (return nil)) (prog (w) (setq w (
  602. car var1047)) (progn (princ " ") (prin w))) (setq var1047 (cdr var1047)) (go
  603. lab1046)) (terpri) (setq tagged nil)))))) (setq var1049 (cdr var1049)) (go
  604. lab1048)) (return pc)))
  605. (de s!:plant_bytes (vec pc bytelist doc) (prog nil (if (or !*plap !*pgwd) (
  606. progn (s!:prinhex4 pc) (princ ":") (ttab 8))) (prog (var1051) (setq var1051
  607. bytelist) lab1050 (if (null var1051) (return nil)) (prog (v) (setq v (car
  608. var1051)) (progn (if (symbolp v) (setq v (get v (quote s!:opcode)))) (if (or
  609. (not (fixp v)) (lessp v 0) (greaterp v 255)) (error "bad byte to put" v)) (
  610. bps!-putv vec pc v) (if (or !*plap !*pgwd) (progn (if (greaterp (posn) 50) (
  611. progn (terpri) (ttab 8))) (s!:prinhex2 v) (princ " "))) (setq pc (plus pc 1))
  612. )) (setq var1051 (cdr var1051)) (go lab1050)) (if (or !*plap !*pgwd) (progn (
  613. if (greaterp (posn) 23) (terpri)) (ttab 23) (princ (car doc)) (prog (var1053)
  614. (setq var1053 (cdr doc)) lab1052 (if (null var1053) (return nil)) (prog (w)
  615. (setq w (car var1053)) (progn (if (greaterp (posn) 65) (progn (terpri) (ttab
  616. 23))) (princ " ") (prin w))) (setq var1053 (cdr var1053)) (go lab1052)) (
  617. terpri))) (return pc)))
  618. (de s!:plant_exit_code (vec pc b labelvals) (prog (w loc low high r) (if (
  619. null b) (return pc) (if (null (cdr b)) (return (s!:plant_bytes vec pc (list (
  620. get (car b) (quote s!:opcode))) b)) (if (equal (car b) (quote ICASE)) (progn
  621. (setq loc (plus pc 3)) (prog (var1055) (setq var1055 (cdr b)) lab1054 (if (
  622. null var1055) (return nil)) (prog (ll) (setq ll (car var1055)) (progn (setq w
  623. (difference (cdr (assoc!*!* ll labelvals)) loc)) (setq loc (plus loc 2)) (if
  624. (lessp w 0) (progn (setq w (minus w)) (setq low (ilogand w 255)) (setq high
  625. (plus 128 (truncate (difference w low) 256)))) (progn (setq low (ilogand w
  626. 255)) (setq high (truncate (difference w low) 256)))) (setq r (cons low (cons
  627. high r))))) (setq var1055 (cdr var1055)) (go lab1054)) (setq r (cons (get (
  628. quote ICASE) (quote s!:opcode)) (cons (length (cddr b)) (reversip r)))) (
  629. return (s!:plant_bytes vec pc r b)))))) (setq w (difference (cdr (assoc!*!* (
  630. cadr b) labelvals)) pc)) (setq w (s!:expand_jump (car b) w)) (return (
  631. s!:plant_bytes vec pc w b))))
  632. (deflist (quote ((JUMPL0NIL ((LOADLOC0) JUMPNIL)) (JUMPL0T ((LOADLOC0) JUMPT)
  633. ) (JUMPL1NIL ((LOADLOC1) JUMPNIL)) (JUMPL1T ((LOADLOC1) JUMPT)) (JUMPL2NIL ((
  634. LOADLOC2) JUMPNIL)) (JUMPL2T ((LOADLOC2) JUMPT)) (JUMPL3NIL ((LOADLOC3)
  635. JUMPNIL)) (JUMPL3T ((LOADLOC3) JUMPT)) (JUMPL4NIL ((LOADLOC4) JUMPNIL)) (
  636. JUMPL4T ((LOADLOC4) JUMPT)) (JUMPL0ATOM ((LOADLOC0) JUMPATOM)) (JUMPL0NATOM (
  637. (LOADLOC0) JUMPNATOM)) (JUMPL1ATOM ((LOADLOC1) JUMPATOM)) (JUMPL1NATOM ((
  638. LOADLOC1) JUMPNATOM)) (JUMPL2ATOM ((LOADLOC2) JUMPATOM)) (JUMPL2NATOM ((
  639. LOADLOC2) JUMPNATOM)) (JUMPL3ATOM ((LOADLOC3) JUMPATOM)) (JUMPL3NATOM ((
  640. LOADLOC3) JUMPNATOM)) (JUMPST0NIL ((STORELOC0) JUMPNIL)) (JUMPST0T ((
  641. STORELOC0) JUMPT)) (JUMPST1NIL ((STORELOC1) JUMPNIL)) (JUMPST1T ((STORELOC1)
  642. JUMPT)) (JUMPST2NIL ((STORELOC2) JUMPNIL)) (JUMPST2T ((STORELOC2) JUMPT)) (
  643. JUMPFREE1NIL ((LOADFREE1) JUMPNIL)) (JUMPFREE1T ((LOADFREE1) JUMPT)) (
  644. JUMPFREE2NIL ((LOADFREE2) JUMPNIL)) (JUMPFREE2T ((LOADFREE2) JUMPT)) (
  645. JUMPFREE3NIL ((LOADFREE3) JUMPNIL)) (JUMPFREE3T ((LOADFREE3) JUMPT)) (
  646. JUMPFREE4NIL ((LOADFREE4) JUMPNIL)) (JUMPFREE4T ((LOADFREE4) JUMPT)) (
  647. JUMPFREENIL ((LOADFREE !*) JUMPNIL)) (JUMPFREET ((LOADFREE !*) JUMPT)) (
  648. JUMPLIT1EQ ((LOADLIT1) JUMPEQ)) (JUMPLIT1NE ((LOADLIT1) JUMPNE)) (JUMPLIT2EQ
  649. ((LOADLIT2) JUMPEQ)) (JUMPLIT2NE ((LOADLIT2) JUMPNE)) (JUMPLIT3EQ ((LOADLIT3)
  650. JUMPEQ)) (JUMPLIT3NE ((LOADLIT3) JUMPNE)) (JUMPLIT4EQ ((LOADLIT4) JUMPEQ)) (
  651. JUMPLIT4NE ((LOADLIT4) JUMPNE)) (JUMPLITEQ ((LOADLIT !*) JUMPEQ)) (JUMPLITNE
  652. ((LOADLIT !*) JUMPNE)) (JUMPLITEQ!* ((LOADLIT !* SWOP) JUMPEQ)) (JUMPLITNE!*
  653. ((LOADLIT !* SWOP) JUMPNE)) (JUMPB1NIL ((BUILTIN1 !*) JUMPNIL)) (JUMPB1T ((
  654. BUILTIN1 !*) JUMPT)) (JUMPB2NIL ((BUILTIN2 !*) JUMPNIL)) (JUMPB2T ((BUILTIN2
  655. !*) JUMPT)) (JUMPFLAGP ((LOADLIT !* FLAGP) JUMPT)) (JUMPNFLAGP ((LOADLIT !*
  656. FLAGP) JUMPNIL)) (JUMPEQCAR ((LOADLIT !* EQCAR) JUMPT)) (JUMPNEQCAR ((LOADLIT
  657. !* EQCAR) JUMPNIL)))) (quote s!:expand_jump))
  658. (fluid (quote (s!:backwards_jump s!:longer_jump)))
  659. (progn (setq s!:backwards_jump (make!-simple!-string 256)) (setq
  660. s!:longer_jump (make!-simple!-string 256)) nil)
  661. (prog (var1057) (setq var1057 (quote ((JUMP JUMP_B JUMP_L JUMP_BL) (JUMPNIL
  662. JUMPNIL_B JUMPNIL_L JUMPNIL_BL) (JUMPT JUMPT_B JUMPT_L JUMPT_BL) (JUMPATOM
  663. JUMPATOM_B JUMPATOM_L JUMPATOM_BL) (JUMPNATOM JUMPNATOM_B JUMPNATOM_L
  664. JUMPNATOM_BL) (JUMPEQ JUMPEQ_B JUMPEQ_L JUMPEQ_BL) (JUMPNE JUMPNE_B JUMPNE_L
  665. JUMPNE_BL) (JUMPEQUAL JUMPEQUAL_B JUMPEQUAL_L JUMPEQUAL_BL) (JUMPNEQUAL
  666. JUMPNEQUAL_B JUMPNEQUAL_L JUMPNEQUAL_BL) (CATCH CATCH_B CATCH_L CATCH_BL))))
  667. lab1056 (if (null var1057) (return nil)) (prog (op) (setq op (car var1057)) (
  668. progn (putv!-char s!:backwards_jump (get (car op) (quote s!:opcode)) (get (
  669. cadr op) (quote s!:opcode))) (putv!-char s!:backwards_jump (get (caddr op) (
  670. quote s!:opcode)) (get (cadddr op) (quote s!:opcode))) (putv!-char
  671. s!:longer_jump (get (car op) (quote s!:opcode)) (get (caddr op) (quote
  672. s!:opcode))) (putv!-char s!:longer_jump (get (cadr op) (quote s!:opcode)) (
  673. get (cadddr op) (quote s!:opcode))))) (setq var1057 (cdr var1057)) (go
  674. lab1056))
  675. (de s!:expand_jump (op offset) (prog (arg low high opcode expanded) (if (not
  676. (atom op)) (progn (setq arg (cadr op)) (setq op (car op)) (setq offset (
  677. difference offset 1)))) (setq expanded (get op (quote s!:expand_jump))) (if (
  678. and expanded (not (and (leq 2 offset) (lessp offset (plus 256 2)) (or (null
  679. arg) (lessp arg 256))))) (progn (setq op (cadr expanded)) (setq expanded (car
  680. expanded)) (if arg (progn (if (greaterp arg 2047) (error
  681. "function uses too many literals (2048 limit)") (if (greaterp arg 255) (prog
  682. (high low) (setq low (ilogand expanded 255)) (setq high (truncate (difference
  683. expanded low) 256)) (setq expanded (plus (cons (quote BIGCALL) (get (car
  684. expanded) (quote s!:longform))) (cons high (cons low (cddr expanded)))))) (
  685. setq expanded (subst arg (quote !*) expanded)))) (setq offset (plus offset 1)
  686. ))) (setq offset (difference offset (length expanded))) (setq arg nil)) (setq
  687. expanded nil)) (setq opcode (get op (quote s!:opcode))) (if (null opcode) (
  688. error 0 (list op offset "invalid block exit"))) (if (and (lessp (plus (minus
  689. 256) 2) offset) (lessp offset (plus 256 2))) (setq offset (difference offset
  690. 2)) (progn (setq high t) (setq offset (difference offset 3)))) (if (lessp
  691. offset 0) (progn (setq opcode (byte!-getv s!:backwards_jump opcode)) (setq
  692. offset (minus offset)))) (if high (progn (setq low (logand offset 255)) (setq
  693. high (truncate (difference offset low) 256))) (if (greaterp (setq low offset
  694. ) 255) (error 0 "Bad offset in expand_jump"))) (if arg (return (list opcode
  695. arg low)) (if (not high) (return (append expanded (list opcode low))) (return
  696. (append expanded (list (byte!-getv s!:longer_jump opcode) high low)))))))
  697. (de s!:comval (x env context) (prog (helper) (setq x (s!:improve x)) (if (
  698. atom x) (return (s!:comatom x env context)) (if (eqcar (car x) (quote lambda)
  699. ) (return (s!:comlambda (cadar x) (cddar x) (cdr x) env context)) (if (eq (
  700. car x) s!:current_function) (s!:comcall x env context) (if (and (setq helper
  701. (get (car x) (quote s!:compilermacro))) (setq helper (funcall helper x env
  702. context))) (return (s!:comval helper env context)) (if (setq helper (get (car
  703. x) (quote s!:newname))) (return (s!:comval (cons helper (cdr x)) env context
  704. )) (if (setq helper (get (car x) (quote s!:compfn))) (return (funcall helper
  705. x env context)) (if (setq helper (macro!-function (car x))) (return (
  706. s!:comval (funcall helper x) env context)) (return (s!:comcall x env context)
  707. ))))))))))
  708. (de s!:comspecform (x env context) (error 0 (list "special form" x)))
  709. (if (null (get (quote and) (quote s!:compfn))) (progn (put (quote
  710. compiler!-let) (quote s!:compfn) (function s!:comspecform)) (put (quote de) (
  711. quote s!:compfn) (function s!:comspecform)) (put (quote defun) (quote
  712. s!:compfn) (function s!:comspecform)) (put (quote eval!-when) (quote
  713. s!:compfn) (function s!:comspecform)) (put (quote flet) (quote s!:compfn) (
  714. function s!:comspecform)) (put (quote labels) (quote s!:compfn) (function
  715. s!:comspecform)) (put (quote macrolet) (quote s!:compfn) (function
  716. s!:comspecform)) (put (quote multiple!-value!-call) (quote s!:compfn) (
  717. function s!:comspecform)) (put (quote multiple!-value!-prog1) (quote
  718. s!:compfn) (function s!:comspecform)) (put (quote prog!*) (quote s!:compfn) (
  719. function s!:comspecform)) (put (quote progv) (quote s!:compfn) (function
  720. s!:comspecform)) nil))
  721. (de s!:improve (u) (prog (w) (if (atom u) (return u) (if (setq w (get (car u)
  722. (quote s!:tidy_fn))) (return (funcall w u)) (if (setq w (get (car u) (quote
  723. s!:newname))) (return (s!:improve (cons w (cdr u)))) (return u))))))
  724. (de s!:imp_minus (u) (prog (a) (setq a (s!:improve (cadr u))) (return (if (
  725. numberp a) (minus a) (if (or (eqcar a (quote minus)) (eqcar a (quote iminus))
  726. ) (cadr a) (if (eqcar a (quote difference)) (s!:improve (list (quote
  727. difference) (caddr a) (cadr a))) (if (eqcar a (quote idifference)) (
  728. s!:improve (list (quote idifference) (caddr a) (cadr a))) (list (car u) a))))
  729. ))))
  730. (put (quote minus) (quote s!:tidy_fn) (quote s!:imp_minus))
  731. (put (quote iminus) (quote s!:tidy_fn) (quote s!:imp_minus))
  732. (de s!:imp_times (u) (prog (a b) (if (not (equal (length u) 3)) (return (cons
  733. (car u) (prog (var1059 var1060) (setq var1059 (cdr u)) lab1058 (if (null
  734. var1059) (return (reversip var1060))) (prog (v) (setq v (car var1059)) (setq
  735. var1060 (cons (s!:improve v) var1060))) (setq var1059 (cdr var1059)) (go
  736. lab1058))))) (setq a (s!:improve (cadr u))) (setq b (s!:improve (caddr u))) (
  737. return (if (equal a 1) b (if (equal b 1) a (if (equal a (minus 1)) (
  738. s!:imp_minus (list (quote minus) b)) (if (equal b (minus 1)) (s!:imp_minus (
  739. list (quote minus) a)) (list (car u) a b))))))))
  740. (put (quote times) (quote s!:tidy_fn) (quote s!:imp_times))
  741. (de s!:imp_itimes (u) (prog (a b) (if (not (equal (length u) 3)) (return (
  742. cons (car u) (prog (var1062 var1063) (setq var1062 (cdr u)) lab1061 (if (null
  743. var1062) (return (reversip var1063))) (prog (v) (setq v (car var1062)) (setq
  744. var1063 (cons (s!:improve v) var1063))) (setq var1062 (cdr var1062)) (go
  745. lab1061))))) (setq a (s!:improve (cadr u))) (setq b (s!:improve (caddr u))) (
  746. return (if (equal a 1) b (if (equal b 1) a (if (equal a (minus 1)) (
  747. s!:imp_minus (list (quote iminus) b)) (if (equal b (minus 1)) (s!:imp_minus (
  748. list (quote iminus) a)) (list (car u) a b))))))))
  749. (put (quote itimes) (quote s!:tidy_fn) (quote s!:imp_itimes))
  750. (de s!:imp_difference (u) (prog (a b) (setq a (s!:improve (cadr u))) (setq b
  751. (s!:improve (caddr u))) (return (if (equal a 0) (s!:imp_minus (list (quote
  752. minus) b)) (if (equal b 0) a (list (car u) a b))))))
  753. (put (quote difference) (quote s!:tidy_fn) (quote s!:imp_difference))
  754. (de s!:imp_idifference (u) (prog (a b) (setq a (s!:improve (cadr u))) (setq b
  755. (s!:improve (caddr u))) (return (if (equal a 0) (s!:imp_minus (list (quote
  756. iminus) b)) (if (equal b 0) a (list (car u) a b))))))
  757. (put (quote idifference) (quote s!:tidy_fn) (quote s!:imp_idifference))
  758. (de s!:alwayseasy (x) t)
  759. (put (quote quote) (quote s!:helpeasy) (function s!:alwayseasy))
  760. (put (quote function) (quote s!:helpeasy) (function s!:alwayseasy))
  761. (de s!:easyifarg (x) (or (null (cdr x)) (and (null (cddr x)) (s!:iseasy (cadr
  762. x)))))
  763. (put (quote ncons) (quote s!:helpeasy) (function s!:easyifarg))
  764. (put (quote car) (quote s!:helpeasy) (function s!:easyifarg))
  765. (put (quote cdr) (quote s!:helpeasy) (function s!:easyifarg))
  766. (put (quote caar) (quote s!:helpeasy) (function s!:easyifarg))
  767. (put (quote cadr) (quote s!:helpeasy) (function s!:easyifarg))
  768. (put (quote cdar) (quote s!:helpeasy) (function s!:easyifarg))
  769. (put (quote cddr) (quote s!:helpeasy) (function s!:easyifarg))
  770. (put (quote caaar) (quote s!:helpeasy) (function s!:easyifarg))
  771. (put (quote caadr) (quote s!:helpeasy) (function s!:easyifarg))
  772. (put (quote cadar) (quote s!:helpeasy) (function s!:easyifarg))
  773. (put (quote caddr) (quote s!:helpeasy) (function s!:easyifarg))
  774. (put (quote cdaar) (quote s!:helpeasy) (function s!:easyifarg))
  775. (put (quote cdadr) (quote s!:helpeasy) (function s!:easyifarg))
  776. (put (quote cddar) (quote s!:helpeasy) (function s!:easyifarg))
  777. (put (quote cdddr) (quote s!:helpeasy) (function s!:easyifarg))
  778. (put (quote caaaar) (quote s!:helpeasy) (function s!:easyifarg))
  779. (put (quote caaadr) (quote s!:helpeasy) (function s!:easyifarg))
  780. (put (quote caadar) (quote s!:helpeasy) (function s!:easyifarg))
  781. (put (quote caaddr) (quote s!:helpeasy) (function s!:easyifarg))
  782. (put (quote cadaar) (quote s!:helpeasy) (function s!:easyifarg))
  783. (put (quote cadadr) (quote s!:helpeasy) (function s!:easyifarg))
  784. (put (quote caddar) (quote s!:helpeasy) (function s!:easyifarg))
  785. (put (quote cadddr) (quote s!:helpeasy) (function s!:easyifarg))
  786. (put (quote cdaaar) (quote s!:helpeasy) (function s!:easyifarg))
  787. (put (quote cdaadr) (quote s!:helpeasy) (function s!:easyifarg))
  788. (put (quote cdadar) (quote s!:helpeasy) (function s!:easyifarg))
  789. (put (quote cdaddr) (quote s!:helpeasy) (function s!:easyifarg))
  790. (put (quote cddaar) (quote s!:helpeasy) (function s!:easyifarg))
  791. (put (quote cddadr) (quote s!:helpeasy) (function s!:easyifarg))
  792. (put (quote cdddar) (quote s!:helpeasy) (function s!:easyifarg))
  793. (put (quote cddddr) (quote s!:helpeasy) (function s!:easyifarg))
  794. (de s!:easygetv (x) (prog (a2) (setq a2 (caddr x)) (if (and (null
  795. !*carcheckflag) (fixp a2) (geq a2 0) (lessp a2 256)) (return (s!:iseasy (cadr
  796. x))) (return nil))))
  797. (put (quote getv) (quote s!:helpeasy) (function s!:easygetv))
  798. (de s!:easyqgetv (x) (prog (a2) (setq a2 (caddr x)) (if (and (fixp a2) (geq
  799. a2 0) (lessp a2 256)) (return (s!:iseasy (cadr x))) (return nil))))
  800. (put (quote qgetv) (quote s!:helpeasy) (function s!:easyqgetv))
  801. (de s!:iseasy (x) (prog (h) (if (atom x) (return t)) (if (not (atom (car x)))
  802. (return nil)) (if (setq h (get (car x) (quote s!:helpeasy))) (return (
  803. funcall h x)) (return nil))))
  804. (de s!:instate_local_decs (v d w) (prog (fg) (if (fluidp v) (return w)) (prog
  805. (var1065) (setq var1065 d) lab1064 (if (null var1065) (return nil)) (prog (z
  806. ) (setq z (car var1065)) (if (and (eqcar z (quote special)) (memq v (cdr z)))
  807. (setq fg t))) (setq var1065 (cdr var1065)) (go lab1064)) (if fg (progn (
  808. make!-special v) (setq w (cons v w)))) (return w)))
  809. (de s!:residual_local_decs (d w) (prog nil (prog (var1069) (setq var1069 d)
  810. lab1068 (if (null var1069) (return nil)) (prog (z) (setq z (car var1069)) (if
  811. (eqcar z (quote special)) (prog (var1067) (setq var1067 (cdr z)) lab1066 (if
  812. (null var1067) (return nil)) (prog (v) (setq v (car var1067)) (if (and (not
  813. (fluidp v)) (not (globalp v))) (progn (make!-special v) (setq w (cons v w))))
  814. ) (setq var1067 (cdr var1067)) (go lab1066)))) (setq var1069 (cdr var1069)) (
  815. go lab1068)) (return w)))
  816. (de s!:cancel_local_decs (w) (unfluid w))
  817. (de s!:find_local_decs (body) (prog (w local_decs) (prog nil lab1070 (if (
  818. null (and body (or (eqcar (car body) (quote declare)) (stringp (car body)))))
  819. (return nil)) (progn (if (stringp (car body)) (setq w (cons (car body) w)) (
  820. setq local_decs (append local_decs (cdar body)))) (setq body (cdr body))) (go
  821. lab1070)) (prog nil lab1071 (if (null w) (return nil)) (progn (setq body (
  822. cons (car w) body)) (setq w (cdr w))) (go lab1071)) (return (cons local_decs
  823. body))))
  824. (de s!:comlambda (bvl body args env context) (prog (s nbvl fluids fl1 w
  825. local_decs) (setq nbvl (setq s (cdr env))) (setq body (s!:find_local_decs
  826. body)) (setq local_decs (car body)) (setq body (cdr body)) (if (atom body) (
  827. setq body nil) (if (atom (cdr body)) (setq body (car body)) (setq body (cons
  828. (quote progn) body)))) (setq w nil) (prog (var1073) (setq var1073 bvl)
  829. lab1072 (if (null var1073) (return nil)) (prog (v) (setq v (car var1073)) (
  830. setq w (s!:instate_local_decs v local_decs w))) (setq var1073 (cdr var1073))
  831. (go lab1072)) (prog (var1075) (setq var1075 bvl) lab1074 (if (null var1075) (
  832. return nil)) (prog (v) (setq v (car var1075)) (progn (if (or (fluidp v) (
  833. globalp v)) (prog (g) (setq g (gensym)) (setq nbvl (cons g nbvl)) (setq fl1 (
  834. cons v fl1)) (setq fluids (cons (cons v g) fluids))) (setq nbvl (cons v nbvl)
  835. )) (if (equal (car args) nil) (s!:outstack 1) (progn (s!:comval (car args)
  836. env 1) (s!:outopcode0 (quote PUSH) (quote (PUSH))))) (rplacd env (cons 0 (cdr
  837. env))) (setq args (cdr args)))) (setq var1075 (cdr var1075)) (go lab1074)) (
  838. rplacd env nbvl) (if fluids (progn (setq fl1 (s!:vecof fl1)) (
  839. s!:outopcode1lit (quote FREEBIND) fl1 env) (prog (var1077) (setq var1077 (
  840. cons nil fluids)) lab1076 (if (null var1077) (return nil)) (prog (v) (setq v
  841. (car var1077)) (rplacd env (cons 0 (cdr env)))) (setq var1077 (cdr var1077))
  842. (go lab1076)) (rplacd env (cons (plus 2 (length fluids)) (cdr env))) (prog (
  843. var1079) (setq var1079 fluids) lab1078 (if (null var1079) (return nil)) (prog
  844. (v) (setq v (car var1079)) (s!:comval (list (quote setq) (car v) (cdr v))
  845. env 2)) (setq var1079 (cdr var1079)) (go lab1078)))) (setq w (
  846. s!:residual_local_decs local_decs w)) (s!:comval body env 1) (
  847. s!:cancel_local_decs w) (if fluids (s!:outopcode0 (quote FREERSTR) (quote (
  848. FREERSTR)))) (s!:outlose (length bvl)) (rplacd env s)))
  849. (de s!:loadliteral (x env) (if (member!*!* (list (quote quote) x)
  850. s!:a_reg_values) nil (progn (if (equal x nil) (s!:outopcode0 (quote VNIL) (
  851. quote (loadlit nil))) (s!:outopcode1lit (quote LOADLIT) x env)) (setq
  852. s!:a_reg_values (list (list (quote quote) x))))))
  853. (de s!:comquote (x env context) (if (leq context 1) (s!:loadliteral (cadr x)
  854. env)))
  855. (put (quote quote) (quote s!:compfn) (function s!:comquote))
  856. (fluid (quote (s!:current_exitlab s!:current_proglabels s!:local_macros)))
  857. (de s!:comfunction (x env context) (if (leq context 1) (progn (setq x (cadr x
  858. )) (if (eqcar x (quote lambda)) (prog (g w s!:used_lexicals) (setq
  859. s!:has_closure t) (setq g (hashtagged!-name (quote lambda) (cdr x))) (setq w
  860. (s!:compile1 g (cadr x) (cddr x) (cons (list (cdr env) s!:current_exitlab
  861. s!:current_proglabels s!:local_macros) s!:lexical_env))) (if s!:used_lexicals
  862. (setq w (s!:compile1 g (cons (gensym) (cadr x)) (cddr x) (cons (list (cdr
  863. env) s!:current_exitlab s!:current_proglabels s!:local_macros) s!:lexical_env
  864. )))) (setq s!:other_defs (append w s!:other_defs)) (s!:loadliteral g env) (
  865. setq w (length (cdr env))) (if s!:used_lexicals (progn (setq s!:has_closure t
  866. ) (if (greaterp w 4095) (error "stack frame > 4095") (if (greaterp w 255) (
  867. s!:outopcode2 (quote BIGSTACK) (plus 128 (truncate w 256)) (logand w 255) (
  868. list (quote CLOSURE) w)) (s!:outopcode1 (quote CLOSURE) w x)))))) (
  869. s!:loadliteral x env)))))
  870. (put (quote function) (quote s!:compfn) (function s!:comfunction))
  871. (de s!:should_be_fluid (x) (if (not (or (fluidp x) (globalp x))) (progn (if
  872. !*pwrds (progn (if (neq (posn) 0) (terpri)) (princ "+++ ") (prin x) (princ
  873. " declared fluid") (terpri))) (fluid (list x)) nil)))
  874. (de s!:find_lexical (x lex n) (prog (p) (if (null lex) (return nil)) (setq p
  875. (memq x (caar lex))) (if p (progn (if (not (memq x s!:used_lexicals)) (setq
  876. s!:used_lexicals (cons x s!:used_lexicals))) (return (list n (length p)))) (
  877. return (s!:find_lexical x (cdr lex) (plus n 1))))))
  878. (global (quote (s!:loadlocs)))
  879. (setq s!:loadlocs (s!:vecof (quote (LOADLOC0 LOADLOC1 LOADLOC2 LOADLOC3
  880. LOADLOC4 LOADLOC5 LOADLOC6 LOADLOC7 LOADLOC8 LOADLOC9 LOADLOC10 LOADLOC11))))
  881. (de s!:comatom (x env context) (prog (n w) (if (greaterp context 1) (return
  882. nil) (if (or (null x) (not (symbolp x))) (return (s!:loadliteral x env)))) (
  883. setq n 0) (setq w (cdr env)) (prog nil lab1080 (if (null (and w (not (eqcar w
  884. x)))) (return nil)) (progn (setq n (add1 n)) (setq w (cdr w))) (go lab1080))
  885. (if w (progn (setq w (cons (quote loc) w)) (if (member!*!* w s!:a_reg_values
  886. ) (return nil) (progn (if (lessp n 12) (s!:outopcode0 (getv s!:loadlocs n) (
  887. list (quote LOADLOC) x)) (if (greaterp n 4095) (error "stack frame > 4095") (
  888. if (greaterp n 255) (s!:outopcode2 (quote BIGSTACK) (truncate n 256) (logand
  889. n 255) (list (quote LOADLOC) x)) (s!:outopcode1 (quote LOADLOC) n x)))) (setq
  890. s!:a_reg_values (list w)) (return nil))))) (if (setq w (s!:find_lexical x
  891. s!:lexical_env 0)) (progn (if (member!*!* (cons (quote lex) w)
  892. s!:a_reg_values) (return nil)) (s!:outlexref (quote LOADLEX) (length (cdr env
  893. )) (car w) (cadr w) x) (setq s!:a_reg_values (list (cons (quote lex) w))) (
  894. return nil))) (s!:should_be_fluid x) (if (flagp x (quote constant!?)) (return
  895. (s!:loadliteral (eval x) env))) (setq w (cons (quote free) x)) (if (
  896. member!*!* w s!:a_reg_values) (return nil)) (s!:outopcode1lit (quote LOADFREE
  897. ) x env) (setq s!:a_reg_values (list w))))
  898. (flag (quote (t !$EOL!$ !$EOF!$)) (quote constant!?))
  899. (de s!:islocal (x env) (prog (n w) (if (or (null x) (not (symbolp x)) (eq x t
  900. )) (return 99999)) (setq n 0) (setq w (cdr env)) (prog nil lab1081 (if (null
  901. (and w (not (eqcar w x)))) (return nil)) (progn (setq n (add1 n)) (setq w (
  902. cdr w))) (go lab1081)) (if w (return n) (return 99999))))
  903. (de s!:load2 (a b env) (progn (if (s!:iseasy b) (prog (wa wb w) (setq wa (
  904. s!:islocal a env)) (setq wb (s!:islocal b env)) (if (and (lessp wa 4) (lessp
  905. wb 4)) (progn (if (and (equal wa 0) (equal wb 1)) (setq w (quote LOC0LOC1)) (
  906. if (and (equal wa 1) (equal wb 2)) (setq w (quote LOC1LOC2)) (if (and (equal
  907. wa 2) (equal wb 3)) (setq w (quote LOC2LOC3)) (if (and (equal wa 1) (equal wb
  908. 0)) (setq w (quote LOC1LOC0)) (if (and (equal wa 2) (equal wb 1)) (setq w (
  909. quote LOC2LOC1)) (if (and (equal wa 3) (equal wb 2)) (setq w (quote LOC3LOC2)
  910. ))))))) (if w (progn (s!:outopcode0 w (list (quote LOCLOC) a b)) (return nil)
  911. )))) (s!:comval a env 1) (setq s!:a_reg_values nil) (s!:comval b env 1) (
  912. return nil)) (if !*ord (progn (s!:comval a env 1) (s!:outopcode0 (quote PUSH)
  913. (quote (PUSH))) (rplacd env (cons 0 (cdr env))) (setq s!:a_reg_values nil) (
  914. s!:comval b env 1) (s!:outopcode0 (quote POP) (quote (POP))) (rplacd env (
  915. cddr env)) t) (if (s!:iseasy a) (progn (s!:comval b env 1) (setq
  916. s!:a_reg_values nil) (s!:comval a env 1) t) (progn (s!:comval b env 1) (
  917. s!:outopcode0 (quote PUSH) (quote (PUSH))) (rplacd env (cons 0 (cdr env))) (
  918. setq s!:a_reg_values nil) (s!:comval a env 1) (s!:outopcode0 (quote POP) (
  919. quote (POP))) (rplacd env (cddr env)) nil))))))
  920. (global (quote (s!:carlocs s!:cdrlocs s!:caarlocs)))
  921. (setq s!:carlocs (s!:vecof (quote (CARLOC0 CARLOC1 CARLOC2 CARLOC3 CARLOC4
  922. CARLOC5 CARLOC6 CARLOC7 CARLOC8 CARLOC9 CARLOC10 CARLOC11))))
  923. (setq s!:cdrlocs (s!:vecof (quote (CDRLOC0 CDRLOC1 CDRLOC2 CDRLOC3 CDRLOC4
  924. CDRLOC5))))
  925. (setq s!:caarlocs (s!:vecof (quote (CAARLOC0 CAARLOC1 CAARLOC2 CAARLOC3))))
  926. (flag (quote (plus2 times2 eq equal)) (quote s!:symmetric))
  927. (flag (quote (car cdr caar cadr cdar cddr ncons add1 sub1 numberp length)) (
  928. quote s!:onearg))
  929. (flag (quote (cons xcons list2 get flagp plus2 difference times2 greaterp
  930. lessp apply1 eq equal getv qgetv eqcar)) (quote s!:twoarg))
  931. (flag (quote (apply2 list2!* list3 acons)) (quote s!:threearg))
  932. (de s!:comcall (x env context) (prog (fn args nargs op s w1 w2 w3 sw) (setq
  933. fn (car x)) (setq args (prog (var1083 var1084) (setq var1083 (cdr x)) lab1082
  934. (if (null var1083) (return (reversip var1084))) (prog (v) (setq v (car
  935. var1083)) (setq var1084 (cons (s!:improve v) var1084))) (setq var1083 (cdr
  936. var1083)) (go lab1082))) (setq nargs (length args)) (if (and (greaterp nargs
  937. 15) !*pwrds) (progn (if (neq (posn) 0) (terpri)) (princ "+++ ") (prin fn) (
  938. princ " called with ") (prin nargs) (princ " from function ") (prin
  939. s!:current_function) (terpri))) (setq s (cdr env)) (if (equal nargs 0) (if (
  940. setq w2 (get fn (quote s!:builtin0))) (s!:outopcode1 (quote BUILTIN0) w2 fn)
  941. (s!:outopcode1lit (quote CALL0) fn env)) (if (equal nargs 1) (progn (if (and
  942. (equal fn (quote car)) (lessp (setq w2 (s!:islocal (car args) env)) 12)) (
  943. s!:outopcode0 (getv s!:carlocs w2) (list (quote carloc) (car args))) (if (and
  944. (equal fn (quote cdr)) (lessp (setq w2 (s!:islocal (car args) env)) 6)) (
  945. s!:outopcode0 (getv s!:cdrlocs w2) (list (quote cdrloc) (car args))) (if (and
  946. (equal fn (quote caar)) (lessp (setq w2 (s!:islocal (car args) env)) 4)) (
  947. s!:outopcode0 (getv s!:caarlocs w2) (list (quote caarloc) (car args))) (progn
  948. (s!:comval (car args) env 1) (if (flagp fn (quote s!:onearg)) (s!:outopcode0
  949. fn (list fn)) (if (setq w2 (get fn (quote s!:builtin1))) (s!:outopcode1 (
  950. quote BUILTIN1) w2 fn) (s!:outopcode1lit (quote CALL1) fn env)))))))) (if (
  951. equal nargs 2) (progn (setq sw (s!:load2 (car args) (cadr args) env)) (if (
  952. flagp fn (quote s!:symmetric)) (setq sw nil)) (if (flagp fn (quote s!:twoarg)
  953. ) (progn (if sw (s!:outopcode0 (quote SWOP) (quote (SWOP)))) (s!:outopcode0
  954. fn (list fn))) (progn (setq w3 (get fn (quote s!:builtin2))) (if sw (progn (
  955. if w3 (s!:outopcode1 (quote BUILTIN2R) w3 fn) (s!:outopcode1lit (quote CALL2R
  956. ) fn env))) (if w3 (s!:outopcode1 (quote BUILTIN2) w3 fn) (s!:outopcode1lit (
  957. quote CALL2) fn env)))))) (if (equal nargs 3) (progn (if (equal (car args)
  958. nil) (s!:outstack 1) (progn (s!:comval (car args) env 1) (s!:outopcode0 (
  959. quote PUSH) (quote (PUSHA3))))) (rplacd env (cons 0 (cdr env))) (setq
  960. s!:a_reg_values nil) (if (s!:load2 (cadr args) (caddr args) env) (
  961. s!:outopcode0 (quote SWOP) (quote (SWOP)))) (if (flagp fn (quote s!:threearg)
  962. ) (s!:outopcode0 (if (equal fn (quote list2!*)) (quote list2star) fn) (list
  963. fn)) (if (setq w2 (get fn (quote s!:builtin3))) (s!:outopcode1 (quote
  964. BUILTIN3) w2 fn) (s!:outopcode1lit (quote CALL3) fn env))) (rplacd env (cddr
  965. env))) (prog (largs) (setq largs (reverse args)) (prog (var1086) (setq
  966. var1086 (reverse (cddr largs))) lab1085 (if (null var1086) (return nil)) (
  967. prog (a) (setq a (car var1086)) (progn (if (null a) (s!:outstack 1) (progn (
  968. s!:comval a env 1) (if (equal nargs 4) (s!:outopcode0 (quote PUSH) (quote (
  969. PUSHA4))) (s!:outopcode0 (quote PUSH) (quote (PUSHARG)))))) (rplacd env (cons
  970. 0 (cdr env))) (setq s!:a_reg_values nil))) (setq var1086 (cdr var1086)) (go
  971. lab1085)) (if (s!:load2 (cadr largs) (car largs) env) (s!:outopcode0 (quote
  972. SWOP) (quote (SWOP)))) (if (and (equal fn (quote apply3)) (equal nargs 4)) (
  973. s!:outopcode0 (quote APPLY3) (quote (APPLY3))) (if (greaterp nargs 255) (
  974. error "Over 255 args in a function call") (s!:outopcode2lit (quote CALLN) fn
  975. nargs (list nargs fn) env))) (rplacd env s))))))))
  976. (de s!:ad_name (l) (if (equal (car l) (quote a)) (if (equal (cadr l) (quote a
  977. )) (quote caar) (quote cadr)) (if (equal (cadr l) (quote a)) (quote cdar) (
  978. quote cddr))))
  979. (de s!:comcarcdr3 (x env context) (prog (name outer c1 c2) (setq name (cdr (
  980. explode2 (car x)))) (setq x (list (s!:ad_name name) (list (if (equal (caddr
  981. name) (quote a)) (quote car) (quote cdr)) (cadr x)))) (return (s!:comval x
  982. env context))))
  983. (put (quote caaar) (quote s!:compfn) (function s!:comcarcdr3))
  984. (put (quote caadr) (quote s!:compfn) (function s!:comcarcdr3))
  985. (put (quote cadar) (quote s!:compfn) (function s!:comcarcdr3))
  986. (put (quote caddr) (quote s!:compfn) (function s!:comcarcdr3))
  987. (put (quote cdaar) (quote s!:compfn) (function s!:comcarcdr3))
  988. (put (quote cdadr) (quote s!:compfn) (function s!:comcarcdr3))
  989. (put (quote cddar) (quote s!:compfn) (function s!:comcarcdr3))
  990. (put (quote cdddr) (quote s!:compfn) (function s!:comcarcdr3))
  991. (de s!:comcarcdr4 (x env context) (prog (name outer c1 c2) (setq name (cdr (
  992. explode2 (car x)))) (setq x (list (s!:ad_name name) (list (s!:ad_name (cddr
  993. name)) (cadr x)))) (return (s!:comval x env context))))
  994. (put (quote caaaar) (quote s!:compfn) (function s!:comcarcdr4))
  995. (put (quote caaadr) (quote s!:compfn) (function s!:comcarcdr4))
  996. (put (quote caadar) (quote s!:compfn) (function s!:comcarcdr4))
  997. (put (quote caaddr) (quote s!:compfn) (function s!:comcarcdr4))
  998. (put (quote cadaar) (quote s!:compfn) (function s!:comcarcdr4))
  999. (put (quote cadadr) (quote s!:compfn) (function s!:comcarcdr4))
  1000. (put (quote caddar) (quote s!:compfn) (function s!:comcarcdr4))
  1001. (put (quote cadddr) (quote s!:compfn) (function s!:comcarcdr4))
  1002. (put (quote cdaaar) (quote s!:compfn) (function s!:comcarcdr4))
  1003. (put (quote cdaadr) (quote s!:compfn) (function s!:comcarcdr4))
  1004. (put (quote cdadar) (quote s!:compfn) (function s!:comcarcdr4))
  1005. (put (quote cdaddr) (quote s!:compfn) (function s!:comcarcdr4))
  1006. (put (quote cddaar) (quote s!:compfn) (function s!:comcarcdr4))
  1007. (put (quote cddadr) (quote s!:compfn) (function s!:comcarcdr4))
  1008. (put (quote cdddar) (quote s!:compfn) (function s!:comcarcdr4))
  1009. (put (quote cddddr) (quote s!:compfn) (function s!:comcarcdr4))
  1010. (de s!:comgetv (x env context) (if !*carcheckflag (s!:comcall x env context)
  1011. (s!:comval (cons (quote qgetv) (cdr x)) env context)))
  1012. (put (quote getv) (quote s!:compfn) (function s!:comgetv))
  1013. (de s!:comqgetv (x env context) (if (and (fixp (caddr x)) (geq (caddr x) 0) (
  1014. lessp (caddr x) 256)) (progn (s!:comval (cadr x) env 1) (s!:outopcode1 (quote
  1015. QGETVN) (caddr x) (caddr x))) (s!:comcall x env context)))
  1016. (put (quote qgetv) (quote s!:compfn) (function s!:comqgetv))
  1017. (de s!:comget (x env context) (prog (a b c w) (setq a (cadr x)) (setq b (
  1018. caddr x)) (setq c (cdddr x)) (if (eqcar b (quote quote)) (progn (setq b (cadr
  1019. b)) (setq w (symbol!-make!-fastget b nil)) (if c (progn (if w (progn (if (
  1020. s!:load2 a b env) (s!:outopcode0 (quote SWOP) (quote (SWOP)))) (s!:outopcode1
  1021. (quote FASTGET) (logor w 64) b)) (s!:comcall x env context))) (progn (
  1022. s!:comval a env 1) (if w (s!:outopcode1 (quote FASTGET) w b) (
  1023. s!:outopcode1lit (quote LITGET) b env))))) (s!:comcall x env context))))
  1024. (put (quote get) (quote s!:compfn) (function s!:comget))
  1025. (de s!:comflagp (x env context) (prog (a b) (setq a (cadr x)) (setq b (caddr
  1026. x)) (if (eqcar b (quote quote)) (progn (setq b (cadr b)) (s!:comval a env 1)
  1027. (setq a (symbol!-make!-fastget b nil)) (if a (s!:outopcode1 (quote FASTGET) (
  1028. logor a 128) b) (s!:comcall x env context))) (s!:comcall x env context))))
  1029. (put (quote flagp) (quote s!:compfn) (function s!:comflagp))
  1030. (de s!:complus (x env context) (s!:comval (expand (cdr x) (quote plus2)) env
  1031. context))
  1032. (put (quote plus) (quote s!:compfn) (function s!:complus))
  1033. (de s!:comtimes (x env context) (s!:comval (expand (cdr x) (quote times2))
  1034. env context))
  1035. (put (quote times) (quote s!:compfn) (function s!:comtimes))
  1036. (de s!:comiplus (x env context) (s!:comval (expand (cdr x) (quote iplus2))
  1037. env context))
  1038. (put (quote iplus) (quote s!:compfn) (function s!:comiplus))
  1039. (de s!:comitimes (x env context) (s!:comval (expand (cdr x) (quote itimes2))
  1040. env context))
  1041. (put (quote itimes) (quote s!:compfn) (function s!:comitimes))
  1042. (de s!:complus2 (x env context) (prog (a b) (setq a (s!:improve (cadr x))) (
  1043. setq b (s!:improve (caddr x))) (return (if (and (numberp a) (numberp b)) (
  1044. s!:comval (plus a b) env context) (if (equal a 0) (s!:comval b env context) (
  1045. if (equal a 1) (s!:comval (list (quote add1) b) env context) (if (equal b 0)
  1046. (s!:comval a env context) (if (equal b 1) (s!:comval (list (quote add1) a)
  1047. env context) (if (equal b (minus 1)) (s!:comval (list (quote sub1) a) env
  1048. context) (s!:comcall x env context))))))))))
  1049. (put (quote plus2) (quote s!:compfn) (function s!:complus2))
  1050. (de s!:comdifference (x env context) (prog (a b) (setq a (s!:improve (cadr x)
  1051. )) (setq b (s!:improve (caddr x))) (return (if (and (numberp a) (numberp b))
  1052. (s!:comval (difference a b) env context) (if (equal a 0) (s!:comval (list (
  1053. quote minus) b) env context) (if (equal b 0) (s!:comval a env context) (if (
  1054. equal b 1) (s!:comval (list (quote sub1) a) env context) (if (equal b (minus
  1055. 1)) (s!:comval (list (quote add1) a) env context) (s!:comcall x env context))
  1056. )))))))
  1057. (put (quote difference) (quote s!:compfn) (function s!:comdifference))
  1058. (de s!:comiplus2 (x env context) (prog (a b) (setq a (s!:improve (cadr x))) (
  1059. setq b (s!:improve (caddr x))) (return (if (and (numberp a) (numberp b)) (
  1060. s!:comval (plus a b) env context) (if (equal a 1) (s!:comval (list (quote
  1061. iadd1) b) env context) (if (equal b 1) (s!:comval (list (quote iadd1) a) env
  1062. context) (if (equal b (minus 1)) (s!:comval (list (quote isub1) a) env
  1063. context) (s!:comcall x env context))))))))
  1064. (put (quote iplus2) (quote s!:compfn) (function s!:comiplus2))
  1065. (de s!:comidifference (x env context) (prog (a b) (setq a (s!:improve (cadr x
  1066. ))) (setq b (s!:improve (caddr x))) (return (if (and (numberp a) (numberp b))
  1067. (s!:comval (difference a b) env context) (if (equal b 1) (s!:comval (list (
  1068. quote isub1) a) env context) (if (equal b (minus 1)) (s!:comval (list (quote
  1069. iadd1) a) env context) (s!:comcall x env context)))))))
  1070. (put (quote idifference) (quote s!:compfn) (function s!:comidifference))
  1071. (de s!:comtimes2 (x env context) (prog (a b) (setq a (s!:improve (cadr x))) (
  1072. setq b (s!:improve (caddr x))) (return (if (and (numberp a) (numberp b)) (
  1073. s!:comval (times a b) env context) (if (equal a 1) (s!:comval b env context)
  1074. (if (equal a (minus 1)) (s!:comval (list (quote minus) b) env context) (if (
  1075. equal b 1) (s!:comval a env context) (if (equal b (minus 1)) (s!:comval (list
  1076. (quote minus) a) env context) (s!:comcall x env context)))))))))
  1077. (put (quote times2) (quote s!:compfn) (function s!:comtimes2))
  1078. (put (quote itimes2) (quote s!:compfn) (function s!:comtimes2))
  1079. (de s!:comminus (x env context) (prog (a b) (setq a (s!:improve (cadr x))) (
  1080. return (if (numberp a) (s!:comval (minus a) env context) (if (eqcar a (quote
  1081. minus)) (s!:comval (cadr a) env context) (s!:comcall x env context))))))
  1082. (put (quote minus) (quote s!:compfn) (function s!:comminus))
  1083. (de s!:comminusp (x env context) (prog (a) (setq a (s!:improve (cadr x))) (if
  1084. (eqcar a (quote difference)) (return (s!:comval (cons (quote lessp) (cdr a))
  1085. env context)) (return (s!:comcall x env context)))))
  1086. (put (quote minusp) (quote s!:compfn) (function s!:comminusp))
  1087. (de s!:comlessp (x env context) (prog (a b) (setq a (s!:improve (cadr x))) (
  1088. setq b (s!:improve (caddr x))) (if (equal b 0) (return (s!:comval (list (
  1089. quote minusp) a) env context)) (return (s!:comcall x env context)))))
  1090. (put (quote lessp) (quote s!:compfn) (function s!:comlessp))
  1091. (de s!:comiminusp (x env context) (prog (a) (setq a (s!:improve (cadr x))) (
  1092. if (eqcar a (quote difference)) (return (s!:comval (cons (quote ilessp) (cdr
  1093. a)) env context)) (return (s!:comcall x env context)))))
  1094. (put (quote iminusp) (quote s!:compfn) (function s!:comiminusp))
  1095. (de s!:comilessp (x env context) (prog (a b) (setq a (s!:improve (cadr x))) (
  1096. setq b (s!:improve (caddr x))) (if (equal b 0) (return (s!:comval (list (
  1097. quote iminusp) a) env context)) (return (s!:comcall x env context)))))
  1098. (put (quote ilessp) (quote s!:compfn) (function s!:comilessp))
  1099. (de s!:comprogn (x env context) (progn (setq x (cdr x)) (if (null x) (
  1100. s!:comval nil env context) (prog (a) (setq a (car x)) (prog nil lab1087 (if (
  1101. null (setq x (cdr x))) (return nil)) (progn (s!:comval a env (if (geq context
  1102. 4) context 2)) (setq a (car x))) (go lab1087)) (s!:comval a env context)))))
  1103. (put (quote progn) (quote s!:compfn) (function s!:comprogn))
  1104. (de s!:comprog1 (x env context) (prog nil (setq x (cdr x)) (if (null x) (
  1105. return (s!:comval nil env context))) (s!:comval (car x) env context) (if (
  1106. null (setq x (cdr x))) (return nil)) (s!:outopcode0 (quote PUSH) (quote (PUSH
  1107. ))) (rplacd env (cons 0 (cdr env))) (prog (var1089) (setq var1089 x) lab1088
  1108. (if (null var1089) (return nil)) (prog (a) (setq a (car var1089)) (s!:comval
  1109. a env (if (geq context 4) context 2))) (setq var1089 (cdr var1089)) (go
  1110. lab1088)) (s!:outopcode0 (quote POP) (quote (POP))) (rplacd env (cddr env))))
  1111. (put (quote prog1) (quote s!:compfn) (function s!:comprog1))
  1112. (de s!:comprog2 (x env context) (prog (a) (setq x (cdr x)) (if (null x) (
  1113. return (s!:comval nil env context))) (setq a (car x)) (s!:comval a env (if (
  1114. geq context 4) context 2)) (s!:comprog1 x env context)))
  1115. (put (quote prog2) (quote s!:compfn) (function s!:comprog2))
  1116. (de s!:outstack (n) (prog (w a) (setq w s!:current_block) (prog nil lab1090 (
  1117. if (null (and w (not (atom (car w))))) (return nil)) (setq w (cdr w)) (go
  1118. lab1090)) (if (eqcar w (quote PUSHNIL)) (setq a 1) (if (eqcar w (quote
  1119. PUSHNIL2)) (setq a 2) (if (eqcar w (quote PUSHNIL3)) (setq a 3) (if (and w (
  1120. numberp (setq a (car w))) (not (equal a 255)) (eqcar (cdr w) (quote PUSHNILS)
  1121. )) (progn (setq w (cdr w)) (setq s!:current_size (difference s!:current_size
  1122. 1))) (setq a nil))))) (if a (progn (setq s!:current_block (cdr w)) (setq
  1123. s!:current_size (difference s!:current_size 1)) (setq n (plus n a)))) (if (
  1124. equal n 1) (s!:outopcode0 (quote PUSHNIL) (quote (PUSHNIL))) (if (equal n 2)
  1125. (s!:outopcode0 (quote PUSHNIL2) (quote (PUSHNIL2))) (if (equal n 3) (
  1126. s!:outopcode0 (quote PUSHNIL3) (quote (PUSHNIL3))) (if (greaterp n 255) (
  1127. progn (s!:outopcode1 (quote PUSHNILS) 255 255) (s!:outstack (difference n 255
  1128. ))) (if (greaterp n 3) (s!:outopcode1 (quote PUSHNILS) n n))))))))
  1129. (de s!:outlose (n) (prog (w a) (setq w s!:current_block) (prog nil lab1091 (
  1130. if (null (and w (not (atom (car w))))) (return nil)) (setq w (cdr w)) (go
  1131. lab1091)) (if (eqcar w (quote LOSE)) (setq a 1) (if (eqcar w (quote LOSE2)) (
  1132. setq a 2) (if (eqcar w (quote LOSE3)) (setq a 3) (if (and w (numberp (setq a
  1133. (car w))) (not (equal a 255)) (eqcar (cdr w) (quote LOSES))) (progn (setq w (
  1134. cdr w)) (setq s!:current_size (difference s!:current_size 1))) (setq a nil)))
  1135. )) (if a (progn (setq s!:current_block (cdr w)) (setq s!:current_size (
  1136. difference s!:current_size 1)) (setq n (plus n a)))) (if (equal n 1) (
  1137. s!:outopcode0 (quote LOSE) (quote (LOSE))) (if (equal n 2) (s!:outopcode0 (
  1138. quote LOSE2) (quote (LOSE2))) (if (equal n 3) (s!:outopcode0 (quote LOSE3) (
  1139. quote (LOSE3))) (if (greaterp n 255) (progn (s!:outopcode1 (quote LOSES) 255
  1140. 255) (s!:outlose (difference n 255))) (if (greaterp n 3) (s!:outopcode1 (
  1141. quote LOSES) n n))))))))
  1142. (de s!:comprog (x env context) (prog (labs s bvl fluids n body local_decs w)
  1143. (setq body (s!:find_local_decs (cddr x))) (setq local_decs (car body)) (setq
  1144. body (cdr body)) (setq n 0) (prog (var1093) (setq var1093 (cadr x)) lab1092 (
  1145. if (null var1093) (return nil)) (prog (v) (setq v (car var1093)) (setq w (
  1146. s!:instate_local_decs v local_decs w))) (setq var1093 (cdr var1093)) (go
  1147. lab1092)) (prog (var1095) (setq var1095 (cadr x)) lab1094 (if (null var1095)
  1148. (return nil)) (prog (v) (setq v (car var1095)) (progn (if (globalp v) (progn
  1149. (if !*pwrds (progn (if (neq (posn) 0) (terpri)) (princ "+++++ global ") (prin
  1150. v) (princ " converted to fluid") (terpri))) (unglobal (list v)) (fluid (list
  1151. v)))) (if (fluidp v) (setq fluids (cons v fluids)) (progn (setq n (plus n 1)
  1152. ) (setq bvl (cons v bvl)))))) (setq var1095 (cdr var1095)) (go lab1094)) (
  1153. setq s (cdr env)) (setq s!:current_exitlab (cons (cons nil (cons (gensym) s))
  1154. s!:current_exitlab)) (s!:outstack n) (rplacd env (append bvl (cdr env))) (if
  1155. fluids (prog (fl1) (setq fl1 (s!:vecof fluids)) (s!:outopcode1lit (quote
  1156. FREEBIND) fl1 env) (prog (var1097) (setq var1097 (cons nil fluids)) lab1096 (
  1157. if (null var1097) (return nil)) (prog (v) (setq v (car var1097)) (rplacd env
  1158. (cons 0 (cdr env)))) (setq var1097 (cdr var1097)) (go lab1096)) (rplacd env (
  1159. cons (plus 2 (length fluids)) (cdr env))) (if (equal context 0) (setq context
  1160. 1)))) (prog (var1099) (setq var1099 (cddr x)) lab1098 (if (null var1099) (
  1161. return nil)) (prog (a) (setq a (car var1099)) (if (atom a) (progn (if (atsoc
  1162. a labs) (progn (if (not (null a)) (progn (if (neq (posn) 0) (terpri)) (princ
  1163. "+++++ label ") (prin a) (princ " multiply defined") (terpri)))) (setq labs (
  1164. cons (cons a (cons (cons (gensym) (cdr env)) nil)) labs)))))) (setq var1099 (
  1165. cdr var1099)) (go lab1098)) (setq s!:current_proglabels (cons labs
  1166. s!:current_proglabels)) (setq w (s!:residual_local_decs local_decs w)) (prog
  1167. (var1101) (setq var1101 (cddr x)) lab1100 (if (null var1101) (return nil)) (
  1168. prog (a) (setq a (car var1101)) (if (not (atom a)) (s!:comval a env (plus
  1169. context 4)) (prog (d) (setq d (atsoc a labs)) (if (null (cddr d)) (progn (
  1170. rplacd (cdr d) t) (s!:set_label (caadr d))))))) (setq var1101 (cdr var1101))
  1171. (go lab1100)) (s!:cancel_local_decs w) (s!:comval nil env context) (if fluids
  1172. (s!:outopcode0 (quote FREERSTR) (quote (FREERSTR)))) (s!:outlose n) (rplacd
  1173. env s) (s!:set_label (cadar s!:current_exitlab)) (setq s!:current_exitlab (
  1174. cdr s!:current_exitlab)) (setq s!:current_proglabels (cdr
  1175. s!:current_proglabels))))
  1176. (put (quote prog) (quote s!:compfn) (function s!:comprog))
  1177. (de s!:comtagbody (x env context) (prog (labs) (prog (var1103) (setq var1103
  1178. (cdr x)) lab1102 (if (null var1103) (return nil)) (prog (a) (setq a (car
  1179. var1103)) (if (atom a) (progn (if (atsoc a labs) (progn (if (not (null a)) (
  1180. progn (if (neq (posn) 0) (terpri)) (princ "+++++ label ") (prin a) (princ
  1181. " multiply defined") (terpri)))) (setq labs (cons (cons a (cons (cons (gensym
  1182. ) (cdr env)) nil)) labs)))))) (setq var1103 (cdr var1103)) (go lab1102)) (
  1183. setq s!:current_proglabels (cons labs s!:current_proglabels)) (prog (var1105)
  1184. (setq var1105 (cdr x)) lab1104 (if (null var1105) (return nil)) (prog (a) (
  1185. setq a (car var1105)) (if (not (atom a)) (s!:comval a env (plus context 4)) (
  1186. prog (d) (setq d (atsoc a labs)) (if (null (cddr d)) (progn (rplacd (cdr d) t
  1187. ) (s!:set_label (caadr d))))))) (setq var1105 (cdr var1105)) (go lab1104)) (
  1188. s!:comval nil env context) (setq s!:current_proglabels (cdr
  1189. s!:current_proglabels))))
  1190. (put (quote tagbody) (quote s!:compfn) (function s!:comtagbody))
  1191. (de s!:comblock (x env context) (prog nil (setq s!:current_exitlab (cons (
  1192. cons (cadr x) (cons (gensym) (cdr env))) s!:current_exitlab)) (s!:comval (
  1193. cons (quote progn) (cddr x)) env context) (s!:set_label (cadar
  1194. s!:current_exitlab)) (setq s!:current_exitlab (cdr s!:current_exitlab))))
  1195. (put (quote !~block) (quote s!:compfn) (function s!:comblock))
  1196. (de s!:comcatch (x env context) (prog (g) (setq g (gensym)) (s!:comval (cadr
  1197. x) env 1) (s!:outjump (quote CATCH) g) (rplacd env (cons (quote (catch)) (
  1198. cons 0 (cons 0 (cdr env))))) (s!:comval (cons (quote progn) (cddr x)) env
  1199. context) (s!:outopcode0 (quote UNCATCH) (quote (UNCATCH))) (rplacd env (
  1200. cddddr env)) (s!:set_label g)))
  1201. (put (quote catch) (quote s!:compfn) (quote s!:comcatch))
  1202. (de s!:comthrow (x env context) (prog nil (s!:comval (cadr x) env 1) (
  1203. s!:outopcode0 (quote PUSH) (quote (PUSH))) (rplacd env (cons 0 (cdr env))) (
  1204. s!:comval (caddr x) env 1) (s!:outopcode0 (quote THROW) (quote (THROW))) (
  1205. rplacd env (cddr env))))
  1206. (put (quote throw) (quote s!:compfn) (quote s!:comthrow))
  1207. (de s!:comunwind!-protect (x env context) (prog (g) (setq g (gensym)) (
  1208. s!:comval (quote (load!-spid)) env 1) (s!:outjump (quote CATCH) g) (rplacd
  1209. env (cons (list (quote unwind!-protect) (cddr x)) (cons 0 (cons 0 (cdr env)))
  1210. )) (s!:comval (cadr x) env context) (s!:outopcode0 (quote PROTECT) (quote (
  1211. PROTECT))) (s!:set_label g) (rplaca (cdr env) 0) (s!:comval (cons (quote
  1212. progn) (cddr x)) env context) (s!:outopcode0 (quote UNPROTECT) (quote (
  1213. UNPROTECT))) (rplacd env (cddddr env))))
  1214. (put (quote unwind!-protect) (quote s!:compfn) (quote s!:comunwind!-protect))
  1215. (de s!:comdeclare (x env context) (prog nil (if !*pwrds (progn (princ "+++ ")
  1216. (prin x) (princ " ignored") (terpri)))))
  1217. (put (quote declare) (quote s!:compfn) (function s!:comdeclare))
  1218. (de s!:expand_let (vl b) (prog (vars vals) (prog (var1107) (setq var1107 vl)
  1219. lab1106 (if (null var1107) (return nil)) (prog (v) (setq v (car var1107)) (if
  1220. (atom v) (progn (setq vars (cons v vars)) (setq vals (cons nil vals))) (if (
  1221. atom (cdr v)) (progn (setq vars (cons (car v) vars)) (setq vals (cons nil
  1222. vals))) (progn (setq vars (cons (car v) vars)) (setq vals (cons (cadr v) vals
  1223. )))))) (setq var1107 (cdr var1107)) (go lab1106)) (return (list (cons (cons (
  1224. quote lambda) (cons vars b)) vals)))))
  1225. (de s!:comlet (x env context) (s!:comval (cons (quote progn) (s!:expand_let (
  1226. cadr x) (cddr x))) env context))
  1227. (put (quote !~let) (quote s!:compfn) (function s!:comlet))
  1228. (de s!:expand_let!* (vl local_decs b) (prog (r var val) (setq r (cons (cons (
  1229. quote declare) local_decs) b)) (prog (var1111) (setq var1111 (reverse vl))
  1230. lab1110 (if (null var1111) (return nil)) (prog (x) (setq x (car var1111)) (
  1231. progn (setq val nil) (if (atom x) (setq var x) (if (atom (cdr x)) (setq var (
  1232. car x)) (progn (setq var (car x)) (setq val (cadr x))))) (prog (var1109) (
  1233. setq var1109 local_decs) lab1108 (if (null var1109) (return nil)) (prog (z) (
  1234. setq z (car var1109)) (if (eqcar z (quote special)) (if (memq var (cdr z)) (
  1235. setq r (cons (list (quote declare) (list (quote special) var)) r))))) (setq
  1236. var1109 (cdr var1109)) (go lab1108)) (setq r (list (list (cons (quote lambda)
  1237. (cons (list var) r)) val))))) (setq var1111 (cdr var1111)) (go lab1110)) (if
  1238. (eqcar (car r) (quote declare)) (setq r (list (cons (quote lambda) (cons nil
  1239. r)))) (setq r (cons (quote progn) r))) (return r)))
  1240. (de s!:comlet!* (x env context) (prog (b) (setq b (s!:find_local_decs (cddr x
  1241. ))) (return (s!:comval (s!:expand_let!* (cadr x) (car b) (cdr b)) env context
  1242. ))))
  1243. (put (quote let!*) (quote s!:compfn) (function s!:comlet!*))
  1244. (de s!:restore_stack (e1 e2) (prog (n) (setq n 0) (prog nil lab1113 (if (null
  1245. (not (equal e1 e2))) (return nil)) (progn (if (null e1) (error 0
  1246. "bad block nesting with GO or RETURN-FROM")) (if (and (numberp (car e1)) (
  1247. greaterp (car e1) 2)) (progn (if (not (zerop n)) (s!:outlose n)) (setq n (car
  1248. e1)) (s!:outopcode0 (quote FREERSTR) (quote (FREERSTR))) (prog (i) (setq i 1
  1249. ) lab1112 (if (minusp (times 1 (difference n i))) (return nil)) (setq e1 (cdr
  1250. e1)) (setq i (plus i 1)) (go lab1112)) (setq n 0)) (if (equal (car e1) (
  1251. quote (catch))) (progn (if (not (zerop n)) (s!:outlose n)) (s!:outopcode0 (
  1252. quote UNCATCH) (quote (UNCATCH))) (setq e1 (cdddr e1)) (setq n 0)) (if (eqcar
  1253. (car e1) (quote unwind!-protect)) (progn (if (not (zerop n)) (s!:outlose n))
  1254. (s!:outopcode0 (quote PROTECT) (quote (PROTECT))) (s!:comval (cons (quote
  1255. progn) (cadar e1)) e1 2) (s!:outopcode0 (quote UNPROTECT) (quote (UNPROTECT))
  1256. ) (setq e1 (cdddr e1)) (setq n 0)) (progn (setq e1 (cdr e1)) (setq n (plus n
  1257. 1))))))) (go lab1113)) (if (not (zerop n)) (s!:outlose n))))
  1258. (de s!:comgo (x env context) (prog (pl d) (if (lessp context 4) (progn (princ
  1259. "go not in program context") (terpri))) (setq pl s!:current_proglabels) (
  1260. prog nil lab1114 (if (null (and pl (null d))) (return nil)) (progn (setq d (
  1261. atsoc (cadr x) (car pl))) (if (null d) (setq pl (cdr pl)))) (go lab1114)) (if
  1262. (null d) (progn (if (neq (posn) 0) (terpri)) (princ "+++++ label ") (prin (
  1263. cadr x)) (princ " not set") (terpri) (return nil))) (setq d (cadr d)) (
  1264. s!:restore_stack (cdr env) (cdr d)) (s!:outjump (quote JUMP) (car d))))
  1265. (put (quote go) (quote s!:compfn) (function s!:comgo))
  1266. (de s!:comreturn!-from (x env context) (prog (tag) (if (lessp context 4) (
  1267. progn (princ "+++++ return or return-from not in prog context") (terpri))) (
  1268. setq x (cdr x)) (setq tag (car x)) (if (cdr x) (setq x (cadr x)) (setq x nil)
  1269. ) (s!:comval x env (difference context 4)) (setq x (atsoc tag
  1270. s!:current_exitlab)) (if (null x) (error 0 (list "invalid return-from" tag)))
  1271. (setq x (cdr x)) (s!:restore_stack (cdr env) (cdr x)) (s!:outjump (quote
  1272. JUMP) (car x))))
  1273. (put (quote return!-from) (quote s!:compfn) (function s!:comreturn!-from))
  1274. (de s!:comreturn (x env context) (s!:comreturn!-from (cons (quote
  1275. return!-from) (cons nil (cdr x))) env context))
  1276. (put (quote return) (quote s!:compfn) (function s!:comreturn))
  1277. (global (quote (s!:jumplts s!:jumplnils s!:jumpatoms s!:jumpnatoms)))
  1278. (setq s!:jumplts (s!:vecof (quote (JUMPL0T JUMPL1T JUMPL2T JUMPL3T JUMPL4T)))
  1279. )
  1280. (setq s!:jumplnils (s!:vecof (quote (JUMPL0NIL JUMPL1NIL JUMPL2NIL JUMPL3NIL
  1281. JUMPL4NIL))))
  1282. (setq s!:jumpatoms (s!:vecof (quote (JUMPL0ATOM JUMPL1ATOM JUMPL2ATOM
  1283. JUMPL3ATOM))))
  1284. (setq s!:jumpnatoms (s!:vecof (quote (JUMPL0NATOM JUMPL1NATOM JUMPL2NATOM
  1285. JUMPL3NATOM))))
  1286. (de s!:jumpif (neg x env lab) (prog (w w1 j) top (if (null x) (progn (if (not
  1287. neg) (s!:outjump (quote JUMP) lab)) (return nil)) (if (or (eq x t) (and (
  1288. eqcar x (quote quote)) (cadr x)) (and (atom x) (not (symbolp x)))) (progn (if
  1289. neg (s!:outjump (quote JUMP) lab)) (return nil)) (if (lessp (setq w (
  1290. s!:islocal x env)) 5) (return (s!:outjump (getv (if neg s!:jumplts
  1291. s!:jumplnils) w) lab)) (if (and (equal w 99999) (symbolp x)) (progn (
  1292. s!:should_be_fluid x) (setq w (list (if neg (quote JUMPFREET) (quote
  1293. JUMPFREENIL)) x x)) (return (s!:record_literal_for_jump w env lab))))))) (if
  1294. (and (not (atom x)) (atom (car x)) (setq w (get (car x) (quote s!:testfn))))
  1295. (return (funcall w neg x env lab))) (if (not (atom x)) (progn (setq w (
  1296. s!:improve x)) (if (or (atom w) (not (eqcar x (car w)))) (progn (setq x w) (
  1297. go top))) (if (and (setq w1 (get (car w) (quote s!:compilermacro))) (setq w1
  1298. (funcall w1 w env 1))) (progn (setq x w1) (go top))))) remacro (if (and (not
  1299. (atom w)) (setq w1 (macro!-function (car w)))) (progn (setq w (funcall w1 w))
  1300. (if (or (atom w) (eqcar w (quote quote)) (get (car w) (quote s!:testfn)) (
  1301. get (car w) (quote s!:compilermacro))) (progn (setq x w) (go top))) (go
  1302. remacro))) (s!:comval x env 1) (setq w s!:current_block) (prog nil lab1115 (
  1303. if (null (and w (not (atom (car w))))) (return nil)) (setq w (cdr w)) (go
  1304. lab1115)) (setq j (quote (JUMPNIL . JUMPT))) (if w (progn (setq w1 (car w)) (
  1305. setq w (cdr w)) (if (equal w1 (quote STORELOC0)) (progn (setq
  1306. s!:current_block w) (setq s!:current_size (difference s!:current_size 1)) (
  1307. setq j (quote (JUMPST0NIL . JUMPST0T)))) (if (equal w1 (quote STORELOC1)) (
  1308. progn (setq s!:current_block w) (setq s!:current_size (difference
  1309. s!:current_size 1)) (setq j (quote (JUMPST1NIL . JUMPST1T)))) (if (equal w1 (
  1310. quote STORELOC2)) (progn (setq s!:current_block w) (setq s!:current_size (
  1311. difference s!:current_size 1)) (setq j (quote (JUMPST2NIL . JUMPST2T)))) (if
  1312. (eqcar w (quote BUILTIN1)) (progn (setq s!:current_block (cdr w)) (setq
  1313. s!:current_size (difference s!:current_size 2)) (setq j (cons (list (quote
  1314. JUMPB1NIL) w1) (list (quote JUMPB1T) w1)))) (if (eqcar w (quote BUILTIN2)) (
  1315. progn (setq s!:current_block (cdr w)) (setq s!:current_size (difference
  1316. s!:current_size 2)) (setq j (cons (list (quote JUMPB2NIL) w1) (list (quote
  1317. JUMPB2T) w1))))))))))) (return (s!:outjump (if neg (cdr j) (car j)) lab))))
  1318. (de s!:testnot (neg x env lab) (s!:jumpif (not neg) (cadr x) env lab))
  1319. (put (quote null) (quote s!:testfn) (function s!:testnot))
  1320. (put (quote not) (quote s!:testfn) (function s!:testnot))
  1321. (de s!:testatom (neg x env lab) (prog (w) (if (lessp (setq w (s!:islocal (
  1322. cadr x) env)) 4) (return (s!:outjump (getv (if neg s!:jumpatoms s!:jumpnatoms
  1323. ) w) lab))) (s!:comval (cadr x) env 1) (if neg (s!:outjump (quote JUMPATOM)
  1324. lab) (s!:outjump (quote JUMPNATOM) lab))))
  1325. (put (quote atom) (quote s!:testfn) (function s!:testatom))
  1326. (de s!:testconsp (neg x env lab) (prog (w) (if (lessp (setq w (s!:islocal (
  1327. cadr x) env)) 4) (return (s!:outjump (getv (if neg s!:jumpnatoms s!:jumpatoms
  1328. ) w) lab))) (s!:comval (cadr x) env 1) (if neg (s!:outjump (quote JUMPNATOM)
  1329. lab) (s!:outjump (quote JUMPATOM) lab))))
  1330. (put (quote consp) (quote s!:testfn) (function s!:testconsp))
  1331. (de s!:comcond (x env context) (prog (l1 l2 w) (setq l1 (gensym)) (prog nil
  1332. lab1116 (if (null (setq x (cdr x))) (return nil)) (progn (setq w (car x)) (if
  1333. (atom (cdr w)) (progn (s!:comval (car w) env 1) (s!:outjump (quote JUMPT) l1
  1334. ) (setq l2 nil)) (progn (if (equal (car w) t) (setq l2 nil) (progn (setq l2 (
  1335. gensym)) (s!:jumpif nil (car w) env l2))) (setq w (cdr w)) (if (null (cdr w))
  1336. (setq w (car w)) (setq w (cons (quote progn) w))) (s!:comval w env context)
  1337. (if l2 (progn (s!:outjump (quote JUMP) l1) (s!:set_label l2)) (setq x (quote
  1338. (nil))))))) (go lab1116)) (if l2 (s!:comval nil env context)) (s!:set_label
  1339. l1)))
  1340. (put (quote cond) (quote s!:compfn) (function s!:comcond))
  1341. (de s!:comif (x env context) (prog (l1 l2) (setq l2 (gensym)) (s!:jumpif nil
  1342. (cadr x) env l2) (setq x (cddr x)) (s!:comval (car x) env context) (setq x (
  1343. cdr x)) (if (or x (and (lessp context 2) (setq x (quote (nil))))) (progn (
  1344. setq l1 (gensym)) (s!:outjump (quote JUMP) l1) (s!:set_label l2) (s!:comval (
  1345. car x) env context) (s!:set_label l1)) (s!:set_label l2))))
  1346. (put (quote if) (quote s!:compfn) (function s!:comif))
  1347. (de s!:comwhen (x env context) (prog (l2) (setq l2 (gensym)) (if (lessp
  1348. context 2) (progn (s!:comval (cadr x) env 1) (s!:outjump (quote JUMPNIL) l2))
  1349. (s!:jumpif nil (cadr x) env l2)) (s!:comval (cons (quote progn) (cddr x))
  1350. env context) (s!:set_label l2)))
  1351. (put (quote when) (quote s!:compfn) (function s!:comwhen))
  1352. (de s!:comunless (x env context) (s!:comwhen (list!* (quote when) (list (
  1353. quote not) (cadr x)) (cddr x)) env context))
  1354. (put (quote unless) (quote s!:compfn) (function s!:comunless))
  1355. (de s!:comicase (x env context) (prog (l1 labs labassoc w) (setq x (cdr x)) (
  1356. prog (var1118) (setq var1118 (cdr x)) lab1117 (if (null var1118) (return nil)
  1357. ) (prog (v) (setq v (car var1118)) (progn (setq w (assoc!*!* v labassoc)) (if
  1358. w (setq l1 (cons (cdr w) l1)) (progn (setq l1 (gensym)) (setq labs (cons l1
  1359. labs)) (setq labassoc (cons (cons v l1) labassoc)))))) (setq var1118 (cdr
  1360. var1118)) (go lab1117)) (s!:comval (car x) env 1) (s!:outjump (quote ICASE) (
  1361. reversip labs)) (setq l1 (gensym)) (prog (var1120) (setq var1120 labassoc)
  1362. lab1119 (if (null var1120) (return nil)) (prog (v) (setq v (car var1120)) (
  1363. progn (s!:set_label (cdr v)) (s!:comval (car v) env context) (s!:outjump (
  1364. quote JUMP) l1))) (setq var1120 (cdr var1120)) (go lab1119)) (s!:set_label l1
  1365. )))
  1366. (put (quote s!:icase) (quote s!:compfn) (function s!:comicase))
  1367. (put (quote JUMPLITEQ!*) (quote s!:opcode) (get (quote JUMPLITEQ) (quote
  1368. s!:opcode)))
  1369. (put (quote JUMPLITNE!*) (quote s!:opcode) (get (quote JUMPLITNE) (quote
  1370. s!:opcode)))
  1371. (de s!:jumpliteql (val lab env) (prog (w) (if (or (idp val) (eq!-safe val)) (
  1372. progn (setq w (list (quote JUMPLITEQ!*) val val)) (s!:record_literal_for_jump
  1373. w env lab)) (progn (s!:outopcode0 (quote PUSH) (quote (PUSH))) (
  1374. s!:loadliteral val env) (s!:outopcode1 (quote BUILTIN2) (get (quote eql) (
  1375. quote s!:builtin2)) (quote eql)) (s!:outjump (quote JUMPT) lab) (flag (list
  1376. lab) (quote s!:jumpliteql)) (s!:outopcode0 (quote POP) (quote (POP)))))))
  1377. (de s!:casebranch (sw env dflt) (prog (size w w1 r g) (setq size (plus 4 (
  1378. truncate (length sw) 2))) (prog nil lab1121 (if (null (or (equal (remainder
  1379. size 2) 0) (equal (remainder size 3) 0) (equal (remainder size 5) 0) (equal (
  1380. remainder size 13) 0))) (return nil)) (setq size (plus size 1)) (go lab1121))
  1381. (prog (var1123) (setq var1123 sw) lab1122 (if (null var1123) (return nil)) (
  1382. prog (p) (setq p (car var1123)) (progn (setq w (remainder (eqlhash (car p))
  1383. size)) (setq w1 (assoc!*!* w r)) (if w1 (rplacd (cdr w1) (cons p (cddr w1)))
  1384. (setq r (cons (list w (gensym) p) r))))) (setq var1123 (cdr var1123)) (go
  1385. lab1122)) (s!:outopcode0 (quote PUSH) (quote (PUSH))) (rplacd env (cons 0 (
  1386. cdr env))) (s!:outopcode1lit (quote CALL1) (quote eqlhash) env) (
  1387. s!:loadliteral size env) (setq g (gensym)) (s!:outopcode1 (quote BUILTIN2) (
  1388. get (quote iremainder) (quote s!:builtin2)) (quote iremainder)) (s!:outjump (
  1389. quote ICASE) (cons g (prog (i var1125) (setq i 0) lab1124 (if (minusp (times
  1390. 1 (difference (difference size 1) i))) (return (reversip var1125))) (setq
  1391. var1125 (cons (progn (setq w (assoc!*!* i r)) (if w (cadr w) g)) var1125)) (
  1392. setq i (plus i 1)) (go lab1124)))) (prog (var1129) (setq var1129 r) lab1128 (
  1393. if (null var1129) (return nil)) (prog (p) (setq p (car var1129)) (progn (
  1394. s!:set_label (cadr p)) (s!:outopcode0 (quote POP) (quote (POP))) (prog (
  1395. var1127) (setq var1127 (cddr p)) lab1126 (if (null var1127) (return nil)) (
  1396. prog (q) (setq q (car var1127)) (s!:jumpliteql (car q) (cdr q) env)) (setq
  1397. var1127 (cdr var1127)) (go lab1126)) (s!:outjump (quote JUMP) dflt))) (setq
  1398. var1129 (cdr var1129)) (go lab1128)) (s!:set_label g) (s!:outopcode0 (quote
  1399. POP) (quote (POP))) (s!:outjump (quote JUMP) dflt) (rplacd env (cddr env))))
  1400. (de s!:comcase (x env context) (prog (keyform blocks v w g dflt sw keys
  1401. nonnum) (setq x (cdr x)) (setq keyform (car x)) (prog (y) (setq y (cdr x))
  1402. lab1132 (if (null y) (return nil)) (progn (setq w (assoc!*!* (cdar y) blocks)
  1403. ) (if w (setq g (cdr w)) (progn (setq g (gensym)) (setq blocks (cons (cons (
  1404. cdar y) g) blocks)))) (setq w (caar y)) (if (and (null (cdr y)) (or (equal w
  1405. t) (equal w (quote otherwise)))) (setq dflt g) (progn (if (atom w) (setq w (
  1406. list w))) (prog (var1131) (setq var1131 w) lab1130 (if (null var1131) (return
  1407. nil)) (prog (n) (setq n (car var1131)) (progn (if (or (idp n) (numberp n)) (
  1408. progn (if (not (fixp n)) (setq nonnum t)) (setq keys (cons n keys)) (setq sw
  1409. (cons (cons n g) sw))) (error 0 (list "illegal case label" n))))) (setq
  1410. var1131 (cdr var1131)) (go lab1130))))) (setq y (cdr y)) (go lab1132)) (if (
  1411. null dflt) (progn (if (setq w (assoc!*!* nil blocks)) (setq dflt (cdr w)) (
  1412. setq blocks (cons (cons nil (setq dflt (gensym))) blocks))))) (if (not nonnum
  1413. ) (progn (setq keys (sort keys (function lessp))) (setq nonnum (car keys)) (
  1414. setq g (lastcar keys)) (if (lessp (difference g nonnum) (times 2 (length keys
  1415. ))) (progn (if (not (equal nonnum 0)) (progn (setq keyform (list (quote
  1416. xdifference) keyform nonnum)) (setq sw (prog (var1134 var1135) (setq var1134
  1417. sw) lab1133 (if (null var1134) (return (reversip var1135))) (prog (y) (setq y
  1418. (car var1134)) (setq var1135 (cons (cons (difference (car y) nonnum) (cdr y)
  1419. ) var1135))) (setq var1134 (cdr var1134)) (go lab1133))))) (s!:comval keyform
  1420. env 1) (setq w nil) (prog (i) (setq i 0) lab1136 (if (minusp (times 1 (
  1421. difference g i))) (return nil)) (if (setq v (assoc!*!* i sw)) (setq w (cons (
  1422. cdr v) w)) (setq w (cons dflt w))) (setq i (plus i 1)) (go lab1136)) (setq w
  1423. (cons dflt (reversip w))) (s!:outjump (quote ICASE) w) (setq nonnum nil)) (
  1424. setq nonnum t)))) (if nonnum (progn (s!:comval keyform env 1) (if (lessp (
  1425. length sw) 7) (progn (prog (var1138) (setq var1138 sw) lab1137 (if (null
  1426. var1138) (return nil)) (prog (y) (setq y (car var1138)) (s!:jumpliteql (car y
  1427. ) (cdr y) env)) (setq var1138 (cdr var1138)) (go lab1137)) (s!:outjump (quote
  1428. JUMP) dflt)) (s!:casebranch sw env dflt)))) (setq g (gensym)) (prog (var1140
  1429. ) (setq var1140 blocks) lab1139 (if (null var1140) (return nil)) (prog (v) (
  1430. setq v (car var1140)) (progn (s!:set_label (cdr v)) (if (flagp (cdr v) (quote
  1431. s!:jumpliteql)) (s!:outlose 1)) (s!:comval (cons (quote progn) (car v)) env
  1432. context) (s!:outjump (quote JUMP) g))) (setq var1140 (cdr var1140)) (go
  1433. lab1139)) (s!:set_label g)))
  1434. (put (quote case) (quote s!:compfn) (function s!:comcase))
  1435. (fluid (quote (!*defn dfprint!* s!:dfprintsave s!:faslmod_name)))
  1436. (de s!:comeval!-when (x env context) (prog (y) (setq x (cdr x)) (setq y (car
  1437. x)) (setq x (cons (quote progn) (cdr x))) (if (memq (quote compile) y) (eval
  1438. x)) (if (memq (quote load) y) (progn (if dfprint!* (apply1 dfprint!* x)))) (
  1439. if (memq (quote eval) y) (s!:comval x env context) (s!:comval nil env context
  1440. ))))
  1441. (put (quote eval!-when) (quote s!:compfn) (function s!:comeval!-when))
  1442. (de s!:comthe (x env context) (s!:comval (caddr x) env context))
  1443. (put (quote the) (quote s!:compfn) (function s!:comthe))
  1444. (de s!:comand (x env context) (prog (l) (setq l (gensym)) (setq x (cdr x)) (
  1445. s!:comval (car x) env 1) (prog nil lab1141 (if (null (setq x (cdr x))) (
  1446. return nil)) (progn (s!:outjump (quote JUMPNIL) l) (s!:comval (car x) env 1))
  1447. (go lab1141)) (s!:set_label l)))
  1448. (put (quote and) (quote s!:compfn) (function s!:comand))
  1449. (de s!:comor (x env context) (prog (l) (setq l (gensym)) (setq x (cdr x)) (
  1450. s!:comval (car x) env 1) (prog nil lab1142 (if (null (setq x (cdr x))) (
  1451. return nil)) (progn (s!:outjump (quote JUMPT) l) (s!:comval (car x) env 1)) (
  1452. go lab1142)) (s!:set_label l)))
  1453. (put (quote or) (quote s!:compfn) (function s!:comor))
  1454. (de s!:combool (neg x env lab) (prog (fn) (setq fn (eqcar x (quote or))) (if
  1455. (eq fn neg) (prog nil lab1143 (if (null (setq x (cdr x))) (return nil)) (
  1456. s!:jumpif fn (car x) env lab) (go lab1143)) (progn (setq neg (gensym)) (prog
  1457. nil lab1144 (if (null (setq x (cdr x))) (return nil)) (s!:jumpif fn (car x)
  1458. env neg) (go lab1144)) (s!:outjump (quote JUMP) lab) (s!:set_label neg)))))
  1459. (put (quote and) (quote s!:testfn) (function s!:combool))
  1460. (put (quote or) (quote s!:testfn) (function s!:combool))
  1461. (de s!:testeq (neg x env lab) (prog (a b) (setq a (s!:improve (cadr x))) (
  1462. setq b (s!:improve (caddr x))) (if (or (s!:eval_to_eq_unsafe a) (
  1463. s!:eval_to_eq_unsafe b)) (progn (if (neq (posn) 0) (terpri)) (princ
  1464. "++++ EQ on number upgraded to EQUAL in ") (prin s!:current_function) (princ
  1465. " : ") (prin a) (princ " ") (print b) (return (s!:testequal neg (cons (quote
  1466. equal) (cdr x)) env lab)))) (if !*carefuleq (progn (s!:comval x env 1) (
  1467. s!:outjump (if neg (quote JUMPT) (quote JUMPNIL)) lab) (return nil))) (if (
  1468. null a) (s!:jumpif (not neg) b env lab) (if (null b) (s!:jumpif (not neg) a
  1469. env lab) (if (or (eqcar a (quote quote)) (and (atom a) (not (symbolp a)))) (
  1470. progn (s!:comval b env 1) (if (eqcar a (quote quote)) (setq a (cadr a))) (
  1471. setq b (list (if neg (quote JUMPLITEQ) (quote JUMPLITNE)) a a)) (
  1472. s!:record_literal_for_jump b env lab)) (if (or (eqcar b (quote quote)) (and (
  1473. atom b) (not (symbolp b)))) (progn (s!:comval a env 1) (if (eqcar b (quote
  1474. quote)) (setq b (cadr b))) (setq a (list (if neg (quote JUMPLITEQ) (quote
  1475. JUMPLITNE)) b b)) (s!:record_literal_for_jump a env lab)) (progn (s!:load2 a
  1476. b env) (if neg (s!:outjump (quote JUMPEQ) lab) (s!:outjump (quote JUMPNE) lab
  1477. )))))))))
  1478. (de s!:testeq1 (neg x env lab) (prog (a b) (if !*carefuleq (progn (s!:comval
  1479. x env 1) (s!:outjump (if neg (quote JUMPT) (quote JUMPNIL)) lab) (return nil)
  1480. )) (setq a (s!:improve (cadr x))) (setq b (s!:improve (caddr x))) (if (null a
  1481. ) (s!:jumpif (not neg) b env lab) (if (null b) (s!:jumpif (not neg) a env lab
  1482. ) (if (or (eqcar a (quote quote)) (and (atom a) (not (symbolp a)))) (progn (
  1483. s!:comval b env 1) (if (eqcar a (quote quote)) (setq a (cadr a))) (setq b (
  1484. list (if neg (quote JUMPLITEQ) (quote JUMPLITNE)) a a)) (
  1485. s!:record_literal_for_jump b env lab)) (if (or (eqcar b (quote quote)) (and (
  1486. atom b) (not (symbolp b)))) (progn (s!:comval a env 1) (if (eqcar b (quote
  1487. quote)) (setq b (cadr b))) (setq a (list (if neg (quote JUMPLITEQ) (quote
  1488. JUMPLITNE)) b b)) (s!:record_literal_for_jump a env lab)) (progn (s!:load2 a
  1489. b env) (if neg (s!:outjump (quote JUMPEQ) lab) (s!:outjump (quote JUMPNE) lab
  1490. )))))))))
  1491. (put (quote eq) (quote s!:testfn) (function s!:testeq))
  1492. (if (eq!-safe 0) (put (quote iequal) (quote s!:testfn) (function s!:testeq1))
  1493. (put (quote iequal) (quote s!:testfn) (function s!:testequal)))
  1494. (de s!:testequal (neg x env lab) (prog (a b) (setq a (cadr x)) (setq b (caddr
  1495. x)) (if (null a) (s!:jumpif (not neg) b env lab) (if (null b) (s!:jumpif (
  1496. not neg) a env lab) (if (or (and (eqcar a (quote quote)) (or (symbolp (cadr a
  1497. )) (eq!-safe (cadr a)))) (and (eqcar b (quote quote)) (or (symbolp (cadr b))
  1498. (eq!-safe (cadr b)))) (eq!-safe a) (eq!-safe b)) (s!:testeq1 neg (cons (quote
  1499. eq) (cdr x)) env lab) (progn (s!:load2 a b env) (if neg (s!:outjump (quote
  1500. JUMPEQUAL) lab) (s!:outjump (quote JUMPNEQUAL) lab))))))))
  1501. (put (quote equal) (quote s!:testfn) (function s!:testequal))
  1502. (de s!:testneq (neg x env lab) (s!:testequal (not neg) (cons (quote equal) (
  1503. cdr x)) env lab))
  1504. (put (quote neq) (quote s!:testfn) (function s!:testneq))
  1505. (de s!:testeqcar (neg x env lab) (prog (a b sw promote) (setq a (cadr x)) (
  1506. setq b (s!:improve (caddr x))) (if (s!:eval_to_eq_unsafe b) (progn (if (neq (
  1507. posn) 0) (terpri)) (princ "++++ EQCAR on number upgraded to EQUALCAR in ") (
  1508. prin s!:current_function) (princ " : ") (print b) (setq promote t)) (if
  1509. !*carefuleq (progn (s!:comval x env 1) (s!:outjump (if neg (quote JUMPT) (
  1510. quote JUMPNIL)) lab) (return nil)))) (if (and (not promote) (eqcar b (quote
  1511. quote))) (progn (s!:comval a env 1) (setq b (cadr b)) (setq a (list (if neg (
  1512. quote JUMPEQCAR) (quote JUMPNEQCAR)) b b)) (s!:record_literal_for_jump a env
  1513. lab)) (progn (setq sw (s!:load2 a b env)) (if sw (s!:outopcode0 (quote SWOP)
  1514. (quote (SWOP)))) (if promote (s!:outopcode1 (quote BUILTIN2) (get (quote
  1515. equalcar) (quote s!:builtin2)) (quote equalcar)) (s!:outopcode0 (quote EQCAR)
  1516. (quote (EQCAR)))) (s!:outjump (if neg (quote JUMPT) (quote JUMPNIL)) lab))))
  1517. )
  1518. (put (quote eqcar) (quote s!:testfn) (function s!:testeqcar))
  1519. (de s!:testflagp (neg x env lab) (prog (a b sw) (setq a (cadr x)) (setq b (
  1520. caddr x)) (if (eqcar b (quote quote)) (progn (s!:comval a env 1) (setq b (
  1521. cadr b)) (setq sw (symbol!-make!-fastget b nil)) (if sw (progn (s!:outopcode1
  1522. (quote FASTGET) (logor sw 128) b) (s!:outjump (if neg (quote JUMPT) (quote
  1523. JUMPNIL)) lab)) (progn (setq a (list (if neg (quote JUMPFLAGP) (quote
  1524. JUMPNFLAGP)) b b)) (s!:record_literal_for_jump a env lab)))) (progn (setq sw
  1525. (s!:load2 a b env)) (if sw (s!:outopcode0 (quote SWOP) (quote (SWOP)))) (
  1526. s!:outopcode0 (quote FLAGP) (quote (FLAGP))) (s!:outjump (if neg (quote JUMPT
  1527. ) (quote JUMPNIL)) lab)))))
  1528. (put (quote flagp) (quote s!:testfn) (function s!:testflagp))
  1529. (global (quote (s!:storelocs)))
  1530. (setq s!:storelocs (s!:vecof (quote (STORELOC0 STORELOC1 STORELOC2 STORELOC3
  1531. STORELOC4 STORELOC5 STORELOC6 STORELOC7))))
  1532. (de s!:comsetq (x env context) (prog (n w var) (setq x (cdr x)) (if (null x)
  1533. (return nil)) (if (or (not (symbolp (car x))) (null (cdr x))) (return (error
  1534. 0 (list "bad args for setq" x)))) (s!:comval (cadr x) env 1) (setq var (car x
  1535. )) (setq n 0) (setq w (cdr env)) (prog nil lab1145 (if (null (and w (not (
  1536. eqcar w var)))) (return nil)) (progn (setq n (add1 n)) (setq w (cdr w))) (go
  1537. lab1145)) (if w (progn (if (not (member!*!* (cons (quote loc) w)
  1538. s!:a_reg_values)) (setq s!:a_reg_values (cons (cons (quote loc) w)
  1539. s!:a_reg_values))) (if (lessp n 8) (s!:outopcode0 (getv s!:storelocs n) (list
  1540. (quote storeloc) var)) (if (greaterp n 4095) (error "stack frame > 4095") (
  1541. if (greaterp n 255) (s!:outopcode2 (quote BIGSTACK) (plus 64 (truncate n 256)
  1542. ) (logand n 255) (list (quote STORELOC) var)) (s!:outopcode1 (quote STORELOC)
  1543. n var))))) (if (setq w (s!:find_lexical var s!:lexical_env 0)) (progn (if (
  1544. not (member!*!* (cons (quote lex) w) s!:a_reg_values)) (setq s!:a_reg_values
  1545. (cons (cons (quote lex) w) s!:a_reg_values))) (s!:outlexref (quote STORELEX)
  1546. (length (cdr env)) (car w) (cadr w) var)) (progn (if (or (null var) (eq var t
  1547. )) (error 0 (list "bad variable in setq" var)) (s!:should_be_fluid var)) (
  1548. setq w (cons (quote free) var)) (if (not (member!*!* w s!:a_reg_values)) (
  1549. setq s!:a_reg_values (cons w s!:a_reg_values))) (s!:outopcode1lit (quote
  1550. STOREFREE) var env)))) (if (cddr x) (return (s!:comsetq (cdr x) env context))
  1551. )))
  1552. (put (quote setq) (quote s!:compfn) (function s!:comsetq))
  1553. (put (quote noisy!-setq) (quote s!:compfn) (function s!:comsetq))
  1554. (de s!:comlist (x env context) (prog (w) (if (null (setq x (cdr x))) (return
  1555. (s!:comval nil env context))) (setq s!:a_reg_values nil) (if (null (setq w (
  1556. cdr x))) (s!:comval (list (quote ncons) (car x)) env context) (if (null (setq
  1557. w (cdr w))) (s!:comval (list (quote list2) (car x) (cadr x)) env context) (
  1558. if (null (cdr w)) (s!:comval (list (quote list3) (car x) (cadr x) (car w))
  1559. env context) (s!:comval (list (quote list2!*) (car x) (cadr x) (cons (quote
  1560. list) w)) env context))))))
  1561. (put (quote list) (quote s!:compfn) (function s!:comlist))
  1562. (de s!:comlist!* (x env context) (prog (w) (if (null (setq x (cdr x))) (
  1563. return (s!:comval nil env context))) (setq s!:a_reg_values nil) (if (null (
  1564. setq w (cdr x))) (s!:comval (car x) env context) (if (null (setq w (cdr w)))
  1565. (s!:comval (list (quote cons) (car x) (cadr x)) env context) (if (null (cdr w
  1566. )) (s!:comval (list (quote list2!*) (car x) (cadr x) (car w)) env context) (
  1567. s!:comval (list (quote list2!*) (car x) (cadr x) (cons (quote list!*) w)) env
  1568. context))))))
  1569. (put (quote list!*) (quote s!:compfn) (function s!:comlist!*))
  1570. (de s!:comcons (x env context) (prog (a b) (setq a (cadr x)) (setq b (caddr x
  1571. )) (if (or (equal b nil) (equal b (quote (quote nil)))) (s!:comval (list (
  1572. quote ncons) a) env context) (if (eqcar a (quote cons)) (s!:comval (list (
  1573. quote acons) (cadr a) (caddr a) b) env context) (if (eqcar b (quote cons)) (
  1574. if (null (caddr b)) (s!:comval (list (quote list2) a (cadr b)) env context) (
  1575. s!:comval (list (quote list2!*) a (cadr b) (caddr b)) env context)) (if (and
  1576. (not !*ord) (s!:iseasy a) (not (s!:iseasy b))) (s!:comval (list (quote xcons)
  1577. b a) env context) (s!:comcall x env context)))))))
  1578. (put (quote cons) (quote s!:compfn) (function s!:comcons))
  1579. (de s!:comapply (x env context) (prog (a b n) (setq a (cadr x)) (setq b (
  1580. caddr x)) (if (and (null (cdddr x)) (eqcar b (quote list))) (progn (if (eqcar
  1581. a (quote quote)) (return (progn (setq n s!:current_function) (prog (
  1582. s!:current_function) (setq s!:current_function (compress (append (explode n)
  1583. (cons (quote !!) (cons (quote !.) (explodec (setq s!:current_count (plus
  1584. s!:current_count 1)))))))) (return (s!:comval (cons (cadr a) (cdr b)) env
  1585. context)))))) (setq n (length (setq b (cdr b)))) (return (s!:comval (cons (
  1586. quote funcall) (cons a b)) env context))) (if (and (null b) (null (cdddr x)))
  1587. (return (s!:comval (list (quote funcall) a) env context)) (return (
  1588. s!:comcall x env context))))))
  1589. (put (quote apply) (quote s!:compfn) (function s!:comapply))
  1590. (de s!:imp_funcall (u) (prog (n) (setq u (cdr u)) (if (eqcar (car u) (quote
  1591. function)) (return (s!:improve (cons (cadar u) (cdr u))))) (setq n (length (
  1592. cdr u))) (setq u (if (equal n 0) (cons (quote apply0) u) (if (equal n 1) (
  1593. cons (quote apply1) u) (if (equal n 2) (cons (quote apply2) u) (if (equal n 3
  1594. ) (cons (quote apply3) u) (cons (quote funcall!*) u)))))) (return u)))
  1595. (put (quote funcall) (quote s!:tidy_fn) (quote s!:imp_funcall))
  1596. (de s!:eval_to_eq_safe (x) (or (null x) (equal x t) (and (not (symbolp x)) (
  1597. eq!-safe x)) (and (not (atom x)) (flagp (car x) (quote eq!-safe))) (and (
  1598. eqcar x (quote quote)) (or (symbolp (cadr x)) (eq!-safe (cadr x))))))
  1599. (de s!:eval_to_eq_unsafe (x) (or (and (atom x) (not (symbolp x)) (not (
  1600. eq!-safe x))) (and (not (atom x)) (flagp (car x) (quote eq!-unsafe))) (and (
  1601. eqcar x (quote quote)) (or (not (atom (cadr x))) (and (not (symbolp (cadr x))
  1602. ) (not (eq!-safe (cadr x))))))))
  1603. (de s!:list_all_eq_safe (u) (or (atom u) (and (or (symbolp (car u)) (eq!-safe
  1604. (car u))) (s!:list_all_eq_safe (cdr u)))))
  1605. (de s!:eval_to_list_all_eq_safe (x) (or (null x) (and (eqcar x (quote quote))
  1606. (s!:list_all_eq_safe (cadr x))) (and (eqcar x (quote list)) (or (null (cdr x
  1607. )) (and (s!:eval_to_eq_safe (cadr x)) (s!:eval_to_list_all_eq_safe (cons (
  1608. quote list) (cddr x)))))) (and (eqcar x (quote cons)) (s!:eval_to_eq_safe (
  1609. cadr x)) (s!:eval_to_list_all_eq_safe (caddr x)))))
  1610. (de s!:eval_to_eq_unsafe (x) (or (and (numberp x) (not (eq!-safe x))) (
  1611. stringp x) (and (eqcar x (quote quote)) (or (not (atom (cadr x))) (and (
  1612. numberp (cadr x)) (not (eq!-safe (cadr x)))) (stringp (cadr x))))))
  1613. (de s!:list_some_eq_unsafe (u) (and (not (atom u)) (or (s!:eval_to_eq_unsafe
  1614. (car u)) (s!:list_some_eq_unsafe (cdr u)))))
  1615. (de s!:eval_to_list_some_eq_unsafe (x) (if (atom x) nil (if (eqcar x (quote
  1616. quote)) (s!:list_some_eq_unsafe (cadr x)) (if (and (eqcar x (quote list)) (
  1617. cdr x)) (or (s!:eval_to_eq_unsafe (cadr x)) (s!:eval_to_list_some_eq_unsafe (
  1618. cons (quote list) (cddr x)))) (if (eqcar x (quote cons)) (or (
  1619. s!:eval_to_eq_unsafe (cadr x)) (s!:eval_to_list_some_eq_unsafe (caddr x)))
  1620. nil)))))
  1621. (de s!:eval_to_car_eq_safe (x) (and (or (eqcar x (quote cons)) (eqcar x (
  1622. quote list))) (not (null (cdr x))) (s!:eval_to_eq_safe (cadr x))))
  1623. (de s!:eval_to_car_eq_unsafe (x) (and (or (eqcar x (quote cons)) (eqcar x (
  1624. quote list))) (not (null (cdr x))) (s!:eval_to_eq_unsafe (cadr x))))
  1625. (de s!:alist_eq_safe (u) (or (atom u) (and (not (atom (car u))) (or (symbolp
  1626. (caar u)) (eq!-safe (caar u))) (s!:alist_eq_safe (cdr u)))))
  1627. (de s!:eval_to_alist_eq_safe (x) (or (null x) (and (eqcar x (quote quote)) (
  1628. s!:alist_eq_safe (cadr x))) (and (eqcar x (quote list)) (or (null (cdr x)) (
  1629. and (s!:eval_to_car_eq_safe (cadr x)) (s!:eval_to_alist_eq_safe (cons (quote
  1630. list) (cddr x)))))) (and (eqcar x (quote cons)) (s!:eval_to_car_eq_safe (cadr
  1631. x)) (s!:eval_to_alist_eq_safe (caddr x)))))
  1632. (de s!:alist_eq_unsafe (u) (and (not (atom u)) (not (atom (car u))) (or (not
  1633. (atom (caar u))) (and (not (symbolp (caar u))) (not (eq!-safe (caar u)))) (
  1634. s!:alist_eq_unsafe (cdr u)))))
  1635. (de s!:eval_to_alist_eq_unsafe (x) (if (null x) nil (if (eqcar x (quote quote
  1636. )) (s!:alist_eq_unsafe (cadr x)) (if (eqcar x (quote list)) (and (cdr x) (or
  1637. (s!:eval_to_car_eq_unsafe (cadr x)) (s!:eval_to_alist_eq_unsafe (cons (quote
  1638. list) (cddr x))))) (if (eqcar x (quote cons)) (or (s!:eval_to_car_eq_unsafe (
  1639. cadr x)) (s!:eval_to_alist_eq_safe (caddr x))) nil)))))
  1640. (flag (quote (eq eqcar null not greaterp lessp geq leq minusp atom numberp
  1641. consp)) (quote eq!-safe))
  1642. (if (not (eq!-safe 1)) (flag (quote (length plus minus difference times
  1643. quotient plus2 times2 expt fix float)) (quote eq!-unsafe)))
  1644. (de s!:comequal (x env context) (if (or (s!:eval_to_eq_safe (cadr x)) (
  1645. s!:eval_to_eq_safe (caddr x))) (s!:comcall (cons (quote eq) (cdr x)) env
  1646. context) (s!:comcall x env context)))
  1647. (put (quote equal) (quote s!:compfn) (function s!:comequal))
  1648. (de s!:comeq (x env context) (if (or (s!:eval_to_eq_unsafe (cadr x)) (
  1649. s!:eval_to_eq_unsafe (caddr x))) (progn (if (neq (posn) 0) (terpri)) (princ
  1650. "++++ EQ on number upgraded to EQUAL in ") (prin s!:current_function) (princ
  1651. " : ") (prin (cadr x)) (princ " ") (print (caddr x)) (s!:comcall (cons (quote
  1652. equal) (cdr x)) env context)) (s!:comcall x env context)))
  1653. (put (quote eq) (quote s!:compfn) (function s!:comeq))
  1654. (de s!:comeqcar (x env context) (if (s!:eval_to_eq_unsafe (caddr x)) (progn (
  1655. if (neq (posn) 0) (terpri)) (princ
  1656. "++++ EQCAR on number upgraded to EQUALCAR in ") (prin s!:current_function) (
  1657. princ " : ") (prin (caddr x)) (s!:comcall (cons (quote equalcar) (cdr x)) env
  1658. context)) (s!:comcall x env context)))
  1659. (put (quote eqcar) (quote s!:compfn) (function s!:comeqcar))
  1660. (de s!:comsublis (x env context) (if (s!:eval_to_alist_eq_safe (cadr x)) (
  1661. s!:comval (cons (quote subla) (cdr x)) env context) (s!:comcall x env context
  1662. )))
  1663. (put (quote sublis) (quote s!:compfn) (function s!:comsublis))
  1664. (de s!:comsubla (x env context) (if (s!:eval_to_alist_eq_unsafe (cadr x)) (
  1665. progn (if (neq (posn) 0) (terpri)) (princ
  1666. "++++ SUBLA on number upgraded to SUBLIS in ") (prin s!:current_function) (
  1667. princ " : ") (print (cadr x)) (s!:comval (cons (quote sublis) (cdr x)) env
  1668. context)) (s!:comcall x env context)))
  1669. (put (quote subla) (quote s!:compfn) (function s!:comsubla))
  1670. (de s!:comassoc (x env context) (if (and (or (s!:eval_to_eq_safe (cadr x)) (
  1671. s!:eval_to_alist_eq_safe (caddr x))) (equal (length x) 3)) (s!:comval (cons (
  1672. quote atsoc) (cdr x)) env context) (if (equal (length x) 3) (s!:comcall (cons
  1673. (quote assoc!*!*) (cdr x)) env context) (s!:comcall x env context))))
  1674. (put (quote assoc) (quote s!:compfn) (function s!:comassoc))
  1675. (put (quote assoc!*!*) (quote s!:compfn) (function s!:comassoc))
  1676. (de s!:comatsoc (x env context) (if (or (s!:eval_to_eq_unsafe (cadr x)) (
  1677. s!:eval_to_alist_eq_unsafe (caddr x))) (progn (if (neq (posn) 0) (terpri)) (
  1678. princ "++++ ATSOC on number upgraded to ASSOC in ") (prin s!:current_function
  1679. ) (princ " : ") (prin (cadr x)) (princ " ") (print (caddr x)) (s!:comval (
  1680. cons (quote assoc) (cdr x)) env context)) (s!:comcall x env context)))
  1681. (put (quote atsoc) (quote s!:compfn) (function s!:comatsoc))
  1682. (de s!:commember (x env context) (if (and (or (s!:eval_to_eq_safe (cadr x)) (
  1683. s!:eval_to_list_all_eq_safe (caddr x))) (equal (length x) 3)) (s!:comval (
  1684. cons (quote memq) (cdr x)) env context) (s!:comcall x env context)))
  1685. (put (quote member) (quote s!:compfn) (function s!:commember))
  1686. (put (quote member!*!*) (quote s!:compfn) (function s!:commember))
  1687. (de s!:commemq (x env context) (if (or (s!:eval_to_eq_unsafe (cadr x)) (
  1688. s!:eval_to_list_some_eq_unsafe (caddr x))) (progn (if (neq (posn) 0) (terpri)
  1689. ) (princ "++++ MEMQ on number upgraded to MEMBER in ") (prin
  1690. s!:current_function) (princ " : ") (prin (cadr x)) (princ " ") (print (caddr
  1691. x)) (s!:comval (cons (quote member) (cdr x)) env context)) (s!:comcall x env
  1692. context)))
  1693. (put (quote memq) (quote s!:compfn) (function s!:commemq))
  1694. (de s!:comdelete (x env context) (if (and (or (s!:eval_to_eq_safe (cadr x)) (
  1695. s!:eval_to_list_all_eq_safe (caddr x))) (equal (length x) 3)) (s!:comval (
  1696. cons (quote deleq) (cdr x)) env context) (s!:comcall x env context)))
  1697. (put (quote delete) (quote s!:compfn) (function s!:comdelete))
  1698. (de s!:comdeleq (x env context) (if (or (s!:eval_to_eq_unsafe (cadr x)) (
  1699. s!:eval_to_list_some_eq_unsafe (caddr x))) (progn (if (neq (posn) 0) (terpri)
  1700. ) (princ "++++ DELEQ on number upgraded to DELETE in ") (prin
  1701. s!:current_function) (princ " : ") (prin (cadr x)) (princ " ") (print (caddr
  1702. x)) (s!:comval (cons (quote delete) (cdr x)) env context)) (s!:comcall x env
  1703. context)))
  1704. (put (quote deleq) (quote s!:compfn) (function s!:comdeleq))
  1705. (de s!:commap (fnargs env context) (prog (carp fn fn1 args var avar moveon l1
  1706. r s closed) (setq fn (car fnargs)) (if (greaterp context 1) (progn (if (
  1707. equal fn (quote mapcar)) (setq fn (quote mapc)) (if (equal fn (quote maplist)
  1708. ) (setq fn (quote map)))))) (if (or (equal fn (quote mapc)) (equal fn (quote
  1709. mapcar)) (equal fn (quote mapcan))) (setq carp t)) (setq fnargs (cdr fnargs))
  1710. (if (atom fnargs) (error 0 "bad arguments to map function")) (setq fn1 (cadr
  1711. fnargs)) (prog nil lab1146 (if (null (or (eqcar fn1 (quote function)) (and (
  1712. eqcar fn1 (quote quote)) (eqcar (cadr fn1) (quote lambda))))) (return nil)) (
  1713. progn (setq fn1 (cadr fn1)) (setq closed t)) (go lab1146)) (setq args (car
  1714. fnargs)) (setq l1 (gensym)) (setq r (gensym)) (setq s (gensym)) (setq var (
  1715. gensym)) (setq avar var) (if carp (setq avar (list (quote car) avar))) (if
  1716. closed (setq fn1 (list fn1 avar)) (setq fn1 (list (quote funcall) fn1 avar)))
  1717. (setq moveon (list (quote setq) var (list (quote cdr) var))) (if (or (equal
  1718. fn (quote map)) (equal fn (quote mapc))) (setq fn (sublis (list (cons (quote
  1719. l1) l1) (cons (quote var) var) (cons (quote fn) fn1) (cons (quote args) args)
  1720. (cons (quote moveon) moveon)) (quote (prog (var) (setq var args) l1 (cond ((
  1721. not var) (return nil))) fn moveon (go l1))))) (if (or (equal fn (quote
  1722. maplist)) (equal fn (quote mapcar))) (setq fn (sublis (list (cons (quote l1)
  1723. l1) (cons (quote var) var) (cons (quote fn) fn1) (cons (quote args) args) (
  1724. cons (quote moveon) moveon) (cons (quote r) r)) (quote (prog (var r) (setq
  1725. var args) l1 (cond ((not var) (return (reversip r)))) (setq r (cons fn r))
  1726. moveon (go l1))))) (setq fn (sublis (list (cons (quote l1) l1) (cons (quote
  1727. l2) (gensym)) (cons (quote var) var) (cons (quote fn) fn1) (cons (quote args)
  1728. args) (cons (quote moveon) moveon) (cons (quote r) (gensym)) (cons (quote s)
  1729. (gensym))) (quote (prog (var r s) (setq var args) (setq r (setq s (list nil)
  1730. )) l1 (cond ((not var) (return (cdr r)))) (rplacd s fn) l2 (cond ((not (atom
  1731. (cdr s))) (setq s (cdr s)) (go l2))) moveon (go l1))))))) (s!:comval fn env
  1732. context)))
  1733. (put (quote map) (quote s!:compfn) (function s!:commap))
  1734. (put (quote maplist) (quote s!:compfn) (function s!:commap))
  1735. (put (quote mapc) (quote s!:compfn) (function s!:commap))
  1736. (put (quote mapcar) (quote s!:compfn) (function s!:commap))
  1737. (put (quote mapcon) (quote s!:compfn) (function s!:commap))
  1738. (put (quote mapcan) (quote s!:compfn) (function s!:commap))
  1739. (de s!:nilargs (use) (if (null use) t (if (or (equal (car use) (quote nil)) (
  1740. equal (car use) (quote (quote nil)))) (s!:nilargs (cdr use)) nil)))
  1741. (de s!:subargs (args use) (if (null use) t (if (null args) (s!:nilargs use) (
  1742. if (not (equal (car args) (car use))) nil (s!:subargs (cdr args) (cdr use))))
  1743. ))
  1744. (fluid (quote (!*where_defined!*)))
  1745. (de clear_source_database nil (progn (setq !*where_defined!* (mkhash 10 2 1.5
  1746. )) nil))
  1747. (de load_source_database (filename) (prog (a b) (clear_source_database) (setq
  1748. a (open filename (quote input))) (if (null a) (return nil)) (setq a (rds a))
  1749. (prog nil lab1147 (if (null (setq b (read))) (return nil)) (puthash (car b)
  1750. !*where_defined!* (cdr b)) (go lab1147)) (close (rds a)) (return nil)))
  1751. (de save_source_database (filename) (prog (a) (setq a (open filename (quote
  1752. output))) (if (null a) (return nil)) (setq a (wrs a)) (prog (var1149) (setq
  1753. var1149 (sort (hashcontents !*where_defined!*) (function orderp))) lab1148 (
  1754. if (null var1149) (return nil)) (prog (z) (setq z (car var1149)) (progn (prin
  1755. z) (terpri))) (setq var1149 (cdr var1149)) (go lab1148)) (princ nil) (terpri
  1756. ) (wrs a) (setq !*where_defined!* nil) (return nil)))
  1757. (de display_source_database nil (prog (w) (if (null !*where_defined!*) (
  1758. return nil)) (setq w (hashcontents !*where_defined!*)) (setq w (sort w (
  1759. function orderp))) (terpri) (prog (var1151) (setq var1151 w) lab1150 (if (
  1760. null var1151) (return nil)) (prog (x) (setq x (car var1151)) (progn (princ (
  1761. car x)) (ttab 40) (prin (cdr x)) (terpri))) (setq var1151 (cdr var1151)) (go
  1762. lab1150))))
  1763. (fluid (quote (s!:r2i_simple_recurse s!:r2i_cons_recurse)))
  1764. (de s!:r2i (name args body) (prog (lab v b1 s!:r2i_simple_recurse
  1765. s!:r2i_cons_recurse) (setq lab (gensym)) (setq v (list (gensym))) (setq b1 (
  1766. s!:r2i1 name args body lab v)) (if s!:r2i_cons_recurse (progn (setq b1 (list
  1767. (quote prog) v lab b1)) (return b1)) (if s!:r2i_simple_recurse (progn (setq v
  1768. (list (gensym))) (setq b1 (s!:r2i2 name args body lab v)) (setq b1 (list (
  1769. quote prog) (cdr v) lab b1)) (return b1)) (return (s!:r2i3 name args body lab
  1770. v))))))
  1771. (de s!:r2i1 (name args body lab v) (if (or (null body) (equal body (quote (
  1772. progn)))) (list (quote return) (list (quote nreverse) (car v))) (if (and (
  1773. eqcar body name) (equal (length (cdr body)) (length args))) (progn (setq
  1774. s!:r2i_simple_recurse t) (cons (quote progn) (append (s!:r2isteps args (cdr
  1775. body) v) (list (list (quote go) lab))))) (if (eqcar body (quote cond)) (cons
  1776. (quote cond) (s!:r2icond name args (cdr body) lab v)) (if (eqcar body (quote
  1777. if)) (cons (quote if) (s!:r2iif name args (cdr body) lab v)) (if (eqcar body
  1778. (quote when)) (cons (quote when) (s!:r2iwhen name args (cdr body) lab v)) (if
  1779. (eqcar body (quote cons)) (s!:r2icons name args (cadr body) (caddr body) lab
  1780. v) (if (or (eqcar body (quote progn)) (eqcar body (quote prog2))) (cons (
  1781. quote progn) (s!:r2iprogn name args (cdr body) lab v)) (if (eqcar body (quote
  1782. and)) (s!:r2i1 name args (s!:r2iand (cdr body)) lab v) (if (eqcar body (
  1783. quote or)) (s!:r2i1 name args (s!:r2ior (cdr body)) lab v) (list (quote
  1784. return) (list (quote nreverse) (car v) body))))))))))))
  1785. (de s!:r2iand (l) (if (null l) t (if (null (cdr l)) (car l) (list (quote cond
  1786. ) (list (car l) (s!:r2iand (cdr l)))))))
  1787. (de s!:r2ior (l) (if (null l) nil (cons (quote cond) (prog (var1153 var1154)
  1788. (setq var1153 l) lab1152 (if (null var1153) (return (reversip var1154))) (
  1789. prog (x) (setq x (car var1153)) (setq var1154 (cons (list x) var1154))) (setq
  1790. var1153 (cdr var1153)) (go lab1152)))))
  1791. (de s!:r2icond (name args b lab v) (if (null b) (list (list t (list (quote
  1792. return) (list (quote nreverse) (car v))))) (if (null (cdar b)) (progn (if (
  1793. null (cdr v)) (rplacd v (list (gensym)))) (cons (list (list (quote setq) (
  1794. cadr v) (caar b)) (list (quote return) (list (quote nreverse) (car v) (cadr v
  1795. )))) (s!:r2icond name args (cdr b) lab v))) (if (eqcar (car b) t) (list (cons
  1796. t (s!:r2iprogn name args (cdar b) lab v))) (cons (cons (caar b) (s!:r2iprogn
  1797. name args (cdar b) lab v)) (s!:r2icond name args (cdr b) lab v))))))
  1798. (de s!:r2iif (name args b lab v) (if (null (cddr b)) (list (car b) (s!:r2i1
  1799. name args (cadr b) lab v)) (list (car b) (s!:r2i1 name args (cadr b) lab v) (
  1800. s!:r2i1 name args (caddr b) lab v))))
  1801. (de s!:r2iwhen (name args b lab v) (cons (car b) (s!:r2iprogn name args (cdr
  1802. b) lab v)))
  1803. (de s!:r2iprogn (name args b lab v) (if (null (cdr b)) (list (s!:r2i1 name
  1804. args (car b) lab v)) (cons (car b) (s!:r2iprogn name args (cdr b) lab v))))
  1805. (de s!:r2icons (name args a d lab v) (if (eqcar d (quote cons)) (s!:r2icons2
  1806. name args a (cadr d) (caddr d) lab v) (if (and (eqcar d name) (equal (length
  1807. (cdr d)) (length args))) (progn (setq s!:r2i_cons_recurse t) (cons (quote
  1808. progn) (cons (list (quote setq) (car v) (list (quote cons) a (car v))) (
  1809. append (s!:r2isteps args (cdr d) v) (list (list (quote go) lab)))))) (list (
  1810. quote return) (list (quote nreverse) (car v) (list (quote cons) a d))))))
  1811. (de s!:r2icons2 (name args a ad dd lab v) (if (and (eqcar dd name) (equal (
  1812. length (cdr dd)) (length args))) (progn (setq s!:r2i_cons_recurse t) (cons (
  1813. quote progn) (cons (list (quote setq) (car v) (list (quote cons) a (car v)))
  1814. (cons (list (quote setq) (car v) (list (quote cons) ad (car v))) (append (
  1815. s!:r2isteps args (cdr dd) v) (list (list (quote go) lab))))))) (list (quote
  1816. return) (list (quote nreverse) (car v) (list (quote cons) a (list (quote cons
  1817. ) ad dd))))))
  1818. (de s!:r2isteps (vars vals v) (if (null vars) (if (null vals) nil (error 0
  1819. "too many args in recursive call to self")) (if (null vals) (error 0
  1820. "not enough args in recursive call to self") (if (equal (car vars) (car vals)
  1821. ) (s!:r2isteps (cdr vars) (cdr vals) v) (if (s!:r2i_safestep (car vars) (cdr
  1822. vars) (cdr vals)) (cons (list (quote setq) (car vars) (car vals)) (
  1823. s!:r2isteps (cdr vars) (cdr vals) v)) (prog (w) (if (null (cdr v)) (rplacd v
  1824. (list (gensym)))) (setq v (cdr v)) (setq w (s!:r2isteps (cdr vars) (cdr vals)
  1825. v)) (return (cons (list (quote setq) (car v) (car vals)) (append w (list (
  1826. list (quote setq) (car vars) (car v))))))))))))
  1827. (de s!:r2i_safestep (x vars vals) (if (and (null vars) (null vals)) t (if (
  1828. s!:r2i_dependson (car vals) x) nil (s!:r2i_safestep x (cdr vars) (cdr vals)))
  1829. ))
  1830. (de s!:r2i_dependson (e x) (if (equal e x) t (if (or (atom e) (eqcar e (quote
  1831. quote))) nil (if (not (atom (car e))) t (if (flagp (car e) (quote
  1832. s!:r2i_safe)) (s!:r2i_list_dependson (cdr e) x) (if (or (fluidp x) (globalp x
  1833. )) t (if (or (flagp (car e) (quote s!:r2i_unsafe)) (macro!-function (car e)))
  1834. t (s!:r2i_list_dependson (cdr e) x))))))))
  1835. (flag (quote (car cdr caar cadr cdar cddr caaar caadr cadar caddr cdaar cdadr
  1836. cddar cdddr cons ncons rcons acons list list2 list3 list!* add1 sub1 plus
  1837. plus2 times times2 difference minus quotient append reverse nreverse null not
  1838. assoc atsoc member memq subst sublis subla pair prog1 prog2 progn)) (quote
  1839. s!:r2i_safe))
  1840. (flag (quote (cond if when case de defun dm defmacro prog let let!* flet and
  1841. or)) (quote s!:r2i_unsafe))
  1842. (de s!:r2i_list_dependson (l x) (if (null l) nil (if (s!:r2i_dependson (car l
  1843. ) x) t (s!:r2i_list_dependson (cdr l) x))))
  1844. (de s!:r2i2 (name args body lab v) (if (or (null body) (equal body (quote (
  1845. progn)))) (list (quote return) nil) (if (and (eqcar body name) (equal (length
  1846. (cdr body)) (length args))) (progn (cons (quote progn) (append (s!:r2isteps
  1847. args (cdr body) v) (list (list (quote go) lab))))) (if (eqcar body (quote
  1848. cond)) (cons (quote cond) (s!:r2i2cond name args (cdr body) lab v)) (if (
  1849. eqcar body (quote if)) (cons (quote if) (s!:r2i2if name args (cdr body) lab v
  1850. )) (if (eqcar body (quote when)) (cons (quote when) (s!:r2i2when name args (
  1851. cdr body) lab v)) (if (or (eqcar body (quote progn)) (eqcar body (quote prog2
  1852. ))) (cons (quote progn) (s!:r2i2progn name args (cdr body) lab v)) (if (eqcar
  1853. body (quote and)) (s!:r2i2 name args (s!:r2iand (cdr body)) lab v) (if (
  1854. eqcar body (quote or)) (s!:r2i2 name args (s!:r2ior (cdr body)) lab v) (list
  1855. (quote return) body))))))))))
  1856. (de s!:r2i2cond (name args b lab v) (if (null b) (list (list t (list (quote
  1857. return) nil))) (if (null (cdar b)) (progn (if (null (cdr v)) (rplacd v (list
  1858. (gensym)))) (cons (list (list (quote setq) (cadr v) (caar b)) (list (quote
  1859. return) (cadr v))) (s!:r2i2cond name args (cdr b) lab v))) (if (eqcar (car b)
  1860. t) (list (cons t (s!:r2i2progn name args (cdar b) lab v))) (cons (cons (caar
  1861. b) (s!:r2i2progn name args (cdar b) lab v)) (s!:r2i2cond name args (cdr b)
  1862. lab v))))))
  1863. (de s!:r2i2if (name args b lab v) (if (null (cddr b)) (list (car b) (s!:r2i2
  1864. name args (cadr b) lab v)) (list (car b) (s!:r2i2 name args (cadr b) lab v) (
  1865. s!:r2i2 name args (caddr b) lab v))))
  1866. (de s!:r2i2when (name args b lab v) (cons (car b) (s!:r2i2progn name args (
  1867. cdr b) lab v)))
  1868. (de s!:r2i2progn (name args b lab v) (if (null (cdr b)) (list (s!:r2i2 name
  1869. args (car b) lab v)) (cons (car b) (s!:r2i2progn name args (cdr b) lab v))))
  1870. (de s!:r2i3 (name args body lab v) (prog (v v1 v2 lab1 lab2 lab3 w P Q g R) (
  1871. if (s!:any_fluid args) (return body)) (if (eqcar body (quote cond)) (progn (
  1872. if (not (setq w (cdr body))) (return body)) (setq P (car w)) (setq w (cdr w))
  1873. (if (null P) (return body)) (setq Q (cdr P)) (setq P (car P)) (if (or (null
  1874. Q) (cdr Q)) (return body)) (setq Q (car Q)) (if (or (null w) (cdr w)) (return
  1875. body)) (setq w (car w)) (if (not (eqcar w t)) (return body)) (setq w (cdr w)
  1876. ) (if (or (not w) (cdr w)) (return body)) (setq w (car w))) (if (eqcar body (
  1877. quote if)) (progn (setq w (cdr body)) (setq P (car w)) (setq w (cdr w)) (setq
  1878. Q (car w)) (setq w (cdr w)) (if (null w) (return body)) (setq w (car w))) (
  1879. return body))) (if (or (atom w) (atom (cdr w)) (atom (cddr w)) (cdddr w)) (
  1880. return body)) (setq g (car w)) (setq R (cadr w)) (setq w (caddr w)) (if (not
  1881. (atom g)) (return body)) (if (member g (quote (and or progn prog1 prog2 cond
  1882. if when))) (return body)) (if (not (eqcar w name)) (return body)) (setq w (
  1883. cdr w)) (if (not (equal (length w) (length args))) (return body)) (setq v1 (
  1884. gensym)) (setq v2 (gensym)) (setq v (list v2)) (setq lab1 (gensym)) (setq
  1885. lab2 (gensym)) (setq lab3 (gensym)) (setq w (s!:r2isteps args w v)) (setq w (
  1886. list (quote prog) (cons v1 v) lab1 (list (quote cond) (list P (list (quote go
  1887. ) lab2))) (list (quote setq) v1 (list (quote cons) R v1)) (cons (quote progn)
  1888. w) (list (quote go) lab1) lab2 (list (quote setq) v2 Q) lab3 (list (quote
  1889. cond) (list (list (quote null) v1) (list (quote return) v2))) (list (quote
  1890. setq) v2 (list g (list (quote car) v1) v2)) (list (quote setq) v1 (list (
  1891. quote cdr) v1)) (list (quote go) lab3))) (return w)))
  1892. (de s!:any_fluid (l) (if (null l) nil (if (fluidp (car l)) t (s!:any_fluid (
  1893. cdr l)))))
  1894. (de s!:compile1 (name args body s!:lexical_env) (prog (w aargs oargs oinit
  1895. restarg svars nargs nopts env fluids s!:current_function s!:current_label
  1896. s!:current_block s!:current_size s!:current_procedure s!:current_exitlab
  1897. s!:current_proglabels s!:other_defs local_decs s!:has_closure s!:local_macros
  1898. s!:recent_literals s!:a_reg_values w1 w2 s!:current_count) (setq
  1899. s!:current_function name) (setq s!:current_count 0) (if !*where_defined!* (
  1900. progn (setq w name) (puthash w !*where_defined!* (where!-was!-that)))) (setq
  1901. body (s!:find_local_decs body)) (setq local_decs (car body)) (setq body (cdr
  1902. body)) (if (atom body) (setq body nil) (if (null (cdr body)) (setq body (car
  1903. body)) (setq body (cons (quote progn) body)))) (setq nargs (setq nopts 0)) (
  1904. prog nil lab1155 (if (null (and args (not (eqcar args (quote !&optional))) (
  1905. not (eqcar args (quote !&rest))))) (return nil)) (progn (if (or (equal (car
  1906. args) (quote !&key)) (equal (car args) (quote !&aux))) (error 0 "&key/&aux"))
  1907. (setq aargs (cons (car args) aargs)) (setq nargs (plus nargs 1)) (setq args
  1908. (cdr args))) (go lab1155)) (if (eqcar args (quote !&optional)) (progn (setq
  1909. args (cdr args)) (prog nil lab1157 (if (null (and args (not (eqcar args (
  1910. quote !&rest))))) (return nil)) (progn (if (or (equal (car args) (quote !&key
  1911. )) (equal (car args) (quote !&aux))) (error 0 "&key/&aux")) (setq w (car args
  1912. )) (prog nil lab1156 (if (null (and (not (atom w)) (or (atom (cdr w)) (equal
  1913. (cdr w) (quote (nil)))))) (return nil)) (setq w (car w)) (go lab1156)) (setq
  1914. args (cdr args)) (setq oargs (cons w oargs)) (setq nopts (plus nopts 1)) (if
  1915. (atom w) (setq aargs (cons w aargs)) (progn (setq oinit t) (setq aargs (cons
  1916. (car w) aargs)) (if (not (atom (cddr w))) (setq svars (cons (caddr w) svars))
  1917. )))) (go lab1157)))) (if (eqcar args (quote !&rest)) (progn (setq w (cadr
  1918. args)) (setq aargs (cons w aargs)) (setq restarg w) (setq args (cddr args)) (
  1919. if args (error 0 "&rest arg not at end")))) (setq args (reverse aargs)) (setq
  1920. oargs (reverse oargs)) (prog (var1159) (setq var1159 (append svars args))
  1921. lab1158 (if (null var1159) (return nil)) (prog (v) (setq v (car var1159)) (
  1922. progn (if (globalp v) (progn (if !*pwrds (progn (if (neq (posn) 0) (terpri))
  1923. (princ "+++++ global ") (prin v) (princ " converted to fluid") (terpri))) (
  1924. unglobal (list v)) (fluid (list v)))))) (setq var1159 (cdr var1159)) (go
  1925. lab1158)) (if oinit (return (s!:compile2 name nargs nopts args oargs restarg
  1926. body local_decs))) (setq w nil) (prog (var1161) (setq var1161 args) lab1160 (
  1927. if (null var1161) (return nil)) (prog (v) (setq v (car var1161)) (setq w (
  1928. s!:instate_local_decs v local_decs w))) (setq var1161 (cdr var1161)) (go
  1929. lab1160)) (if (and !*r2i (null oargs) (null restarg)) (setq body (s!:r2i name
  1930. args body))) (prog (v) (setq v args) lab1162 (if (null v) (return nil)) (
  1931. progn (if (fluidp (car v)) (prog (g) (setq g (gensym)) (setq fluids (cons (
  1932. cons (car v) g) fluids)) (rplaca v g)))) (setq v (cdr v)) (go lab1162)) (if
  1933. fluids (progn (setq body (list (list (quote return) body))) (prog (var1164) (
  1934. setq var1164 fluids) lab1163 (if (null var1164) (return nil)) (prog (v) (setq
  1935. v (car var1164)) (setq body (cons (list (quote setq) (car v) (cdr v)) body))
  1936. ) (setq var1164 (cdr var1164)) (go lab1163)) (setq body (cons (quote prog) (
  1937. cons (prog (var1166 var1167) (setq var1166 fluids) lab1165 (if (null var1166)
  1938. (return (reversip var1167))) (prog (v) (setq v (car var1166)) (setq var1167
  1939. (cons (car v) var1167))) (setq var1166 (cdr var1166)) (go lab1165)) body)))))
  1940. (setq env (cons (mkhash 10 (if s!:faslmod_name 2 1) 1.5) (reverse args))) (
  1941. puthash name (car env) (cons 10000000 nil)) (setq w (s!:residual_local_decs
  1942. local_decs w)) (s!:start_procedure nargs nopts restarg) (setq w1 body) more (
  1943. if (atom w1) nil (if (and (equal (car w1) (quote block)) (equal (length w1) 3
  1944. )) (progn (setq w1 (caddr w1)) (go more)) (if (and (equal (car w1) (quote
  1945. progn)) (equal (length w1) 2)) (progn (setq w1 (cadr w1)) (go more)) (if (and
  1946. (atom (setq w2 (car w1))) (setq w2 (get w2 (quote s!:newname)))) (progn (
  1947. setq w1 (cons w2 (cdr w1))) (go more)) (if (and (atom (setq w2 (car w1))) (
  1948. setq w2 (macro!-function w2))) (progn (setq w1 (funcall w2 w1)) (go more)))))
  1949. )) (if (not (equal (setq w2 (s!:improve w1)) w1)) (progn (setq w1 w2) (go
  1950. more))) (if (and (not (atom w1)) (atom (car w1)) (not (special!-form!-p (car
  1951. w1))) (s!:subargs args (cdr w1)) (leq nargs 3) (equal nopts 0) (not restarg)
  1952. (leq (length (cdr w1)) nargs)) (progn (s!:cancel_local_decs w) (if restarg (
  1953. setq nopts (plus nopts 512))) (setq nopts (plus nopts (times 1024 (length w1)
  1954. ))) (setq nargs (plus nargs (times 256 nopts))) (if !*pwrds (progn (if (neq (
  1955. posn) 0) (terpri)) (princ "+++ ") (prin name) (princ " compiled as link to ")
  1956. (princ (car w1)) (terpri))) (return (cons (cons name (cons nargs (cons nil (
  1957. car w1)))) s!:other_defs)))) (s!:comval body env 0) (s!:cancel_local_decs w)
  1958. (if restarg (setq nopts (plus nopts 512))) (setq nargs (plus nargs (times 256
  1959. nopts))) (return (cons (cons name (cons nargs (s!:endprocedure name env)))
  1960. s!:other_defs))))
  1961. (de s!:compile2 (name nargs nopts args oargs restarg body local_decs) (prog (
  1962. fluids env penv g v init atend w) (prog (var1169) (setq var1169 args) lab1168
  1963. (if (null var1169) (return nil)) (prog (v) (setq v (car var1169)) (progn (
  1964. setq env (cons 0 env)) (setq penv (cons env penv)))) (setq var1169 (cdr
  1965. var1169)) (go lab1168)) (setq env (cons (mkhash 10 (if s!:faslmod_name 2 1)
  1966. 1.5) env)) (puthash name (car env) (cons 10000000 nil)) (setq penv (reversip
  1967. penv)) (if restarg (setq oargs (append oargs (quote (0))))) (prog (i) (setq i
  1968. 1) lab1170 (if (minusp (times 1 (difference nargs i))) (return nil)) (setq
  1969. oargs (cons 0 oargs)) (setq i (plus i 1)) (go lab1170)) (s!:start_procedure
  1970. nargs nopts restarg) (prog nil lab1171 (if (null args) (return nil)) (progn (
  1971. setq v (car args)) (setq init (car oargs)) (if (equal init 0) (progn (setq w
  1972. (s!:instate_local_decs v local_decs w)) (if (fluidp v) (progn (setq g (gensym
  1973. )) (rplaca (car penv) g) (s!:outopcode1lit (quote FREEBIND) (s!:vecof (list v
  1974. )) env) (rplacd env (cons 3 (cons 0 (cons 0 (cdr env))))) (setq atend (cons (
  1975. quote FREERSTR) atend)) (s!:comval (list (quote setq) v g) env 2)) (rplaca (
  1976. car penv) v))) (prog (ival sp l1 l2) (if (not (atom init)) (progn (setq init
  1977. (cdr init)) (setq ival (car init)) (if (not (atom (cdr init))) (setq sp (cadr
  1978. init))))) (setq l1 (gensym)) (setq g (gensym)) (rplaca (car penv) g) (if (
  1979. and (null ival) (null sp)) (s!:comval (list (quote setq) g (list (quote
  1980. spid!-to!-nil) g)) env 1) (progn (s!:jumpif nil (list (quote is!-spid) g) env
  1981. l1) (s!:comval (list (quote setq) g ival) env 1) (if sp (progn (if (fluidp
  1982. sp) (progn (s!:outopcode1lit (quote FREEBIND) (s!:vecof (list sp)) env) (
  1983. s!:outjump (quote JUMP) (setq l2 (gensym))) (s!:set_label l1) (
  1984. s!:outopcode1lit (quote FREEBIND) (s!:vecof (list sp)) env) (rplacd env (cons
  1985. 3 (cons 0 (cons 0 (cdr env))))) (s!:comval (list (quote setq) sp t) env 1) (
  1986. s!:set_label l2) (setq atend (cons (quote FREERSTR) atend))) (progn (
  1987. s!:outopcode0 (quote PUSHNIL) (quote (PUSHNIL))) (s!:outjump (quote JUMP) (
  1988. setq l2 (gensym))) (s!:set_label l1) (s!:loadliteral t env) (s!:outopcode0 (
  1989. quote PUSH) (quote (PUSH))) (s!:set_label l2) (rplacd env (cons sp (cdr env))
  1990. ) (setq atend (cons (quote LOSE) atend))))) (s!:set_label l1)))) (setq w (
  1991. s!:instate_local_decs v local_decs w)) (if (fluidp v) (progn (
  1992. s!:outopcode1lit (quote FREEBIND) (s!:vecof (list v)) env) (rplacd env (cons
  1993. 3 (cons 0 (cons 0 (cdr env))))) (s!:comval (list (quote setq) v g) env 1) (
  1994. setq atend (cons (quote FREERSTR) atend))) (rplaca (car penv) v)))) (setq
  1995. args (cdr args)) (setq oargs (cdr oargs)) (setq penv (cdr penv))) (go lab1171
  1996. )) (setq w (s!:residual_local_decs local_decs w)) (s!:comval body env 0) (
  1997. prog nil lab1172 (if (null atend) (return nil)) (progn (s!:outopcode0 (car
  1998. atend) (list (car atend))) (setq atend (cdr atend))) (go lab1172)) (
  1999. s!:cancel_local_decs w) (setq nopts (plus nopts 256)) (if restarg (setq nopts
  2000. (plus nopts 512))) (setq nargs (plus nargs (times 256 nopts))) (return (cons
  2001. (cons name (cons nargs (s!:endprocedure name env))) s!:other_defs))))
  2002. (de compile!-all nil (prog (var1174) (setq var1174 (oblist)) lab1173 (if (
  2003. null var1174) (return nil)) (prog (x) (setq x (car var1174)) (prog (w) (setq
  2004. w (getd x)) (if (and (or (eqcar w (quote expr)) (eqcar w (quote macro))) (
  2005. eqcar (cdr w) (quote lambda))) (progn (princ "Compile: ") (prin x) (terpri) (
  2006. errorset (list (quote compile) (mkquote (list x))) t t))))) (setq var1174 (
  2007. cdr var1174)) (go lab1173)))
  2008. (flag (quote (rds deflist flag fluid global remprop remflag unfluid unglobal
  2009. dm defmacro carcheck faslend c_end)) (quote eval))
  2010. (flag (quote (rds)) (quote ignore))
  2011. (fluid (quote (!*backtrace)))
  2012. (de s!:fasl_supervisor nil (prog (u w !*echo) top (setq u (errorset (quote (
  2013. read)) t !*backtrace)) (if (atom u) (return nil)) (setq u (car u)) (if (equal
  2014. u !$eof!$) (return nil)) (if (not (atom u)) (setq u (macroexpand u))) (if (
  2015. atom u) (go top) (if (eqcar u (quote faslend)) (return (apply (quote faslend)
  2016. nil)) (if (eqcar u (quote rdf)) (progn (setq w (open (setq u (eval (cadr u))
  2017. ) (quote input))) (if w (progn (terpri) (princ "Reading file ") (prin u) (
  2018. terpri) (setq w (rds w)) (s!:fasl_supervisor) (princ "End of file ") (prin u)
  2019. (terpri) (close (rds w))) (progn (princ "Failed to open file ") (prin u) (
  2020. terpri)))) (s!:fslout0 u)))) (go top)))
  2021. (de s!:fslout0 (u) (s!:fslout1 u nil))
  2022. (de s!:fslout1 (u loadonly) (prog (w) (if (not (atom u)) (setq u (macroexpand
  2023. u))) (if (atom u) (return nil) (if (eqcar u (quote progn)) (progn (prog (
  2024. var1176) (setq var1176 (cdr u)) lab1175 (if (null var1176) (return nil)) (
  2025. prog (v) (setq v (car var1176)) (s!:fslout1 v loadonly)) (setq var1176 (cdr
  2026. var1176)) (go lab1175)) (return nil)) (if (eqcar u (quote eval!-when)) (
  2027. return (prog nil (setq w (cadr u)) (setq u (cons (quote progn) (cddr u))) (if
  2028. (and (memq (quote compile) w) (not loadonly)) (eval u)) (if (memq (quote
  2029. load) w) (s!:fslout1 u t)) (return nil))) (if (or (flagp (car u) (quote eval)
  2030. ) (and (equal (car u) (quote setq)) (not (atom (caddr u))) (flagp (caaddr u)
  2031. (quote eval)))) (if (not loadonly) (errorset u t !*backtrace)))))) (if (eqcar
  2032. u (quote rdf)) (prog nil (setq w (open (setq u (eval (cadr u))) (quote input
  2033. ))) (if w (progn (princ "Reading file ") (prin u) (terpri) (setq w (rds w)) (
  2034. s!:fasl_supervisor) (princ "End of file ") (prin u) (terpri) (close (rds w)))
  2035. (progn (princ "Failed to open file ") (prin u) (terpri)))) (if !*nocompile (
  2036. progn (if (and (not (eqcar u (quote faslend))) (not (eqcar u (quote carcheck)
  2037. ))) (write!-module u))) (if (or (eqcar u (quote de)) (eqcar u (quote defun)))
  2038. (progn (setq u (cdr u)) (if (and (setq w (get (car u) (quote c!-version))) (
  2039. equal w (md60 (cons (cadr u) (s!:fully_macroexpand_list (cddr u)))))) (progn
  2040. (princ "+++ ") (prin (car u)) (printc " not compiled (C version available)")
  2041. (write!-module (list (quote restore!-c!-code) (mkquote (car u))))) (if (flagp
  2042. (car u) (quote lose)) (progn (princ "+++ ") (prin (car u)) (printc
  2043. " not compiled (LOSE flag)")) (prog (var1178) (setq var1178 (s!:compile1 (car
  2044. u) (cadr u) (cddr u) nil)) lab1177 (if (null var1178) (return nil)) (prog (p
  2045. ) (setq p (car var1178)) (s!:fslout2 p u)) (setq var1178 (cdr var1178)) (go
  2046. lab1177))))) (if (or (eqcar u (quote dm)) (eqcar u (quote defmacro))) (prog (
  2047. g) (setq g (hashtagged!-name (cadr u) (cddr u))) (setq u (cdr u)) (if (flagp
  2048. (car u) (quote lose)) (progn (princ "+++ ") (prin (car u)) (printc
  2049. " not compiled (LOSE flag)") (return nil))) (setq w (cadr u)) (if (and w (
  2050. null (cdr w))) (setq w (cons (car w) (cons (quote !&optional) (cons (gensym)
  2051. nil))))) (prog (var1180) (setq var1180 (s!:compile1 g w (cddr u) nil))
  2052. lab1179 (if (null var1180) (return nil)) (prog (p) (setq p (car var1180)) (
  2053. s!:fslout2 p u)) (setq var1180 (cdr var1180)) (go lab1179)) (write!-module (
  2054. list (quote dm) (car u) (quote (u !&optional e)) (list g (quote u) (quote e))
  2055. ))) (if (eqcar u (quote putd)) (prog (a1 a2 a3) (setq a1 (cadr u)) (setq a2 (
  2056. caddr u)) (setq a3 (cadddr u)) (if (and (eqcar a1 (quote quote)) (or (equal
  2057. a2 (quote (quote expr))) (equal a2 (quote (quote macro)))) (or (eqcar a3 (
  2058. quote quote)) (eqcar a3 (quote function))) (eqcar (cadr a3) (quote lambda)))
  2059. (progn (setq a1 (cadr a1)) (setq a2 (cadr a2)) (setq a3 (cadr a3)) (setq u (
  2060. cons (if (equal a2 (quote expr)) (quote de) (quote dm)) (cons a1 (cdr a3))))
  2061. (s!:fslout1 u loadonly)) (write!-module u))) (if (and (not (eqcar u (quote
  2062. faslend))) (not (eqcar u (quote carcheck)))) (write!-module u)))))))))
  2063. (de s!:fslout2 (p u) (prog (name nargs code env w) (setq name (car p)) (setq
  2064. nargs (cadr p)) (setq code (caddr p)) (setq env (cdddr p)) (if (and !*savedef
  2065. (equal name (car u))) (progn (define!-in!-module (minus 1)) (write!-module (
  2066. cons (quote lambda) (cons (cadr u) (s!:fully_macroexpand_list (cddr u)))))))
  2067. (setq w (irightshift nargs 18)) (setq nargs (logand nargs 262143)) (if (not (
  2068. equal w 0)) (setq code (difference w 1))) (define!-in!-module nargs) (
  2069. write!-module name) (write!-module code) (write!-module env)))
  2070. (de faslend nil (prog nil (if (null s!:faslmod_name) (return nil)) (
  2071. start!-module nil) (setq dfprint!* s!:dfprintsave) (setq !*defn nil) (setq
  2072. !*comp (cdr s!:faslmod_name)) (setq s!:faslmod_name nil) (return nil)))
  2073. (put (quote faslend) (quote stat) (quote endstat))
  2074. (de faslout (u) (prog nil (terpri) (princ "FASLOUT ") (prin u) (princ
  2075. ": IN files; or type in expressions") (terpri) (princ
  2076. "When all done, execute FASLEND;") (terpri) (if (not (atom u)) (setq u (car u
  2077. ))) (if (not (start!-module u)) (progn (if (neq (posn) 0) (terpri)) (princ
  2078. "+++ Failed to open FASL output file") (terpri) (return nil))) (setq
  2079. s!:faslmod_name (cons u !*comp)) (setq s!:dfprintsave dfprint!*) (setq
  2080. dfprint!* (quote s!:fslout0)) (setq !*defn t) (setq !*comp nil) (if (getd (
  2081. quote begin)) (return nil)) (s!:fasl_supervisor)))
  2082. (put (quote faslout) (quote stat) (quote rlis))
  2083. (de s!:c_supervisor nil (prog (u w !*echo) top (setq u (errorset (quote (read
  2084. )) t !*backtrace)) (if (atom u) (return nil)) (setq u (car u)) (if (equal u
  2085. !$eof!$) (return nil)) (if (not (atom u)) (setq u (macroexpand u))) (if (atom
  2086. u) (go top) (if (eqcar u (quote c_end)) (return (apply (quote c_end) nil)) (
  2087. if (eqcar u (quote rdf)) (progn (setq w (open (setq u (eval (cadr u))) (quote
  2088. input))) (if w (progn (terpri) (princ "Reading file ") (prin u) (terpri) (
  2089. setq w (rds w)) (s!:c_supervisor) (princ "End of file ") (prin u) (terpri) (
  2090. close (rds w))) (progn (princ "Failed to open file ") (prin u) (terpri)))) (
  2091. s!:cout0 u)))) (go top)))
  2092. (de s!:cout0 (u) (s!:cout1 u nil))
  2093. (de s!:cout1 (u loadonly) (prog (s!:into_c) (setq s!:into_c t) (if (not (atom
  2094. u)) (setq u (macroexpand u))) (if (atom u) (return nil) (if (eqcar u (quote
  2095. progn)) (progn (prog (var1182) (setq var1182 (cdr u)) lab1181 (if (null
  2096. var1182) (return nil)) (prog (v) (setq v (car var1182)) (s!:cout1 v loadonly)
  2097. ) (setq var1182 (cdr var1182)) (go lab1181)) (return nil)) (if (eqcar u (
  2098. quote eval!-when)) (return (prog (w) (setq w (cadr u)) (setq u (cons (quote
  2099. progn) (cddr u))) (if (and (memq (quote compile) w) (not loadonly)) (eval u))
  2100. (if (memq (quote load) w) (s!:cout1 u t)) (return nil))) (if (or (flagp (car
  2101. u) (quote eval)) (and (equal (car u) (quote setq)) (not (atom (caddr u))) (
  2102. flagp (caaddr u) (quote eval)))) (if (not loadonly) (errorset u t !*backtrace
  2103. )))))) (if (eqcar u (quote rdf)) (prog (w) (setq w (open (setq u (eval (cadr
  2104. u))) (quote input))) (if w (progn (princ "Reading file ") (prin u) (terpri) (
  2105. setq w (rds w)) (s!:c_supervisor) (princ "End of file ") (prin u) (terpri) (
  2106. close (rds w))) (progn (princ "Failed to open file ") (prin u) (terpri)))) (
  2107. if (or (eqcar u (quote de)) (eqcar u (quote defun))) (prog (w) (setq u (cdr u
  2108. )) (setq w (s!:compile1 (car u) (cadr u) (cddr u) nil)) (prog (var1184) (setq
  2109. var1184 w) lab1183 (if (null var1184) (return nil)) (prog (p) (setq p (car
  2110. var1184)) (s!:cgen (car p) (cadr p) (caddr p) (cdddr p))) (setq var1184 (cdr
  2111. var1184)) (go lab1183))) (if (or (eqcar u (quote dm)) (eqcar u (quote
  2112. defmacro))) (prog (w g) (setq g (hashtagged!-name (cadr u) (cddr u))) (setq u
  2113. (cdr u)) (setq w (cadr u)) (if (and w (null (cdr w))) (setq w (cons (car w)
  2114. (cons (quote !&optional) (cons (gensym) nil))))) (setq w (s!:compile1 g w (
  2115. cddr u) nil)) (prog (var1186) (setq var1186 w) lab1185 (if (null var1186) (
  2116. return nil)) (prog (p) (setq p (car var1186)) (s!:cgen (car p) (cadr p) (
  2117. caddr p) (cdddr p))) (setq var1186 (cdr var1186)) (go lab1185)) (s!:cinit (
  2118. list (quote dm) (car u) (quote (u !&optional e)) (list g (quote u) (quote e))
  2119. ))) (if (eqcar u (quote putd)) (prog (a1 a2 a3) (setq a1 (cadr u)) (setq a2 (
  2120. caddr u)) (setq a3 (cadddr u)) (if (and (eqcar a1 (quote quote)) (or (equal
  2121. a2 (quote (quote expr))) (equal a2 (quote (quote macro)))) (or (eqcar a3 (
  2122. quote quote)) (eqcar a3 (quote function))) (eqcar (cadr a3) (quote lambda)))
  2123. (progn (setq a1 (cadr a1)) (setq a2 (cadr a2)) (setq a3 (cadr a3)) (setq u (
  2124. cons (if (equal a2 (quote expr)) (quote de) (quote dm)) (cons a1 (cdr a3))))
  2125. (s!:cout1 u loadonly)) (s!:cinit u))) (if (and (not (eqcar u (quote c_end)))
  2126. (not (eqcar u (quote carcheck)))) (s!:cinit u))))))))
  2127. (fluid (quote (s!:cmod_name)))
  2128. (de c_end nil (prog nil (if (null s!:cmod_name) (return nil)) (s!:cend) (setq
  2129. dfprint!* s!:dfprintsave) (setq !*defn nil) (setq !*comp (cdr s!:cmod_name))
  2130. (setq s!:cmod_name nil) (return nil)))
  2131. (put (quote c_end) (quote stat) (quote endstat))
  2132. (de c_out (u) (prog nil (terpri) (princ "C_OUT ") (prin u) (princ
  2133. ": IN files; or type in expressions") (terpri) (princ
  2134. "When all done, execute C_END;") (terpri) (if (not (atom u)) (setq u (car u))
  2135. ) (if (null (s!:cstart u)) (progn (if (neq (posn) 0) (terpri)) (princ
  2136. "+++ Failed to open C output file") (terpri) (return nil))) (setq
  2137. s!:cmod_name (cons u !*comp)) (setq s!:dfprintsave dfprint!*) (setq dfprint!*
  2138. (quote s!:cout0)) (setq !*defn t) (setq !*comp nil) (if (getd (quote begin))
  2139. (return nil)) (s!:c_supervisor)))
  2140. (put (quote c_out) (quote stat) (quote rlis))
  2141. (de s!:compile!-file!* (fromfile !&optional tofile verbose !*pwrds) (prog (
  2142. !*comp w save) (if (null tofile) (setq tofile fromfile)) (if verbose (progn (
  2143. if (neq (posn) 0) (terpri)) (princ "+++ Compiling file ") (prin fromfile) (
  2144. terpri) (setq save (verbos nil)) (verbos (ilogand save 4)))) (if (not (
  2145. start!-module tofile)) (progn (if (neq (posn) 0) (terpri)) (princ
  2146. "+++ Failed to open FASL output file") (terpri) (if save (verbos save)) (
  2147. return nil))) (setq w (open fromfile (quote input))) (if w (progn (setq w (
  2148. rds w)) (s!:fasl_supervisor) (close (rds w))) (progn (princ
  2149. "Failed to open file ") (prin fromfile) (terpri))) (if save (verbos save)) (
  2150. start!-module nil) (if verbose (progn (if (neq (posn) 0) (terpri)) (princ
  2151. "+++ Compilation complete") (terpri))) (return t)))
  2152. (de compile!-file!* (fromfile !&optional tofile) (s!:compile!-file!* fromfile
  2153. tofile t t))
  2154. (de compd (name type defn) (prog (g !*comp) (setq !*comp t) (if (eqcar defn (
  2155. quote lambda)) (progn (setq g (dated!-name type)) (symbol!-set!-definition g
  2156. defn) (compile (list g)) (setq defn g))) (put name type defn) (return name)))
  2157. (de s!:compile0 (name) (prog (w args defn) (setq defn (getd name)) (if (and (
  2158. eqcar defn (quote macro)) (eqcar (cdr defn) (quote lambda))) (prog (!*comp lx
  2159. vx bx) (setq lx (cdr defn)) (if (not (or (and (equal (length lx) 3) (not (
  2160. atom (setq bx (caddr lx)))) (equal (cadr lx) (cdr bx))) (and (equal (length
  2161. lx) 3) (not (atom (setq bx (caddr lx)))) (not (atom (cadr lx))) (eqcar (cdadr
  2162. lx) (quote !&optional)) (not (atom (setq bx (cdr bx)))) (equal (caadr lx) (
  2163. car bx)) (equal (cddadr lx) (cdr bx))))) (progn (setq w (hashtagged!-name
  2164. name defn)) (symbol!-set!-definition w (cdr defn)) (s!:compile0 w) (if (equal
  2165. 1 (length (cadr lx))) (symbol!-set!-env name (list (quote (u !&optional env)
  2166. ) (list w (quote u)))) (symbol!-set!-env name (list (quote (u !&optional env)
  2167. ) (list w (quote u) (quote env)))))))) (if (or (not (eqcar defn (quote expr))
  2168. ) (not (eqcar (cdr defn) (quote lambda)))) (progn (if !*pwrds (progn (if (neq
  2169. (posn) 0) (terpri)) (princ "+++ ") (prin name) (princ " not compilable") (
  2170. terpri)))) (progn (setq args (cddr defn)) (setq defn (cdr args)) (setq args (
  2171. car args)) (if (stringp args) (progn (if !*pwrds (progn (if (neq (posn) 0) (
  2172. terpri)) (princ "+++ ") (prin name) (princ " was already compiled") (terpri))
  2173. )) (progn (if !*savedef (put name (quote !*savedef) (cons (quote lambda) (
  2174. cons args (s!:fully_macroexpand_list defn))))) (setq w (s!:compile1 name args
  2175. defn nil)) (prog (var1188) (setq var1188 w) lab1187 (if (null var1188) (
  2176. return nil)) (prog (p) (setq p (car var1188)) (symbol!-set!-definition (car p
  2177. ) (cdr p))) (setq var1188 (cdr var1188)) (go lab1187)))))))))
  2178. (de s!:fully_macroexpand_list (l) (if (atom l) l (prog (var1190 var1191) (
  2179. setq var1190 l) lab1189 (if (null var1190) (return (reversip var1191))) (prog
  2180. (u) (setq u (car var1190)) (setq var1191 (cons (s!:fully_macroexpand u)
  2181. var1191))) (setq var1190 (cdr var1190)) (go lab1189))))
  2182. (de s!:fully_macroexpand (x) (prog (helper) (if (or (atom x) (eqcar x (quote
  2183. quote))) (return x) (if (eqcar (car x) (quote lambda)) (return (cons (cons (
  2184. quote lambda) (cons (cadar x) (s!:fully_macroexpand_list (cddar x)))) (
  2185. s!:fully_macroexpand_list (cdr x)))) (if (setq helper (get (car x) (quote
  2186. s!:newname))) (return (s!:fully_macroexpand (cons helper (cdr x)))) (if (setq
  2187. helper (get (car x) (quote s!:expandfn))) (return (funcall helper x)) (if (
  2188. setq helper (macro!-function (car x))) (return (s!:fully_macroexpand (funcall
  2189. helper x))) (return (cons (car x) (s!:fully_macroexpand_list (cdr x)))))))))
  2190. ))
  2191. (de s!:expandfunction (u) u)
  2192. (de s!:expandflet (u) (cons (car u) (cons (prog (var1193 var1194) (setq
  2193. var1193 (cadr u)) lab1192 (if (null var1193) (return (reversip var1194))) (
  2194. prog (b) (setq b (car var1193)) (setq var1194 (cons (s!:expandfletvars b)
  2195. var1194))) (setq var1193 (cdr var1193)) (go lab1192)) (
  2196. s!:fully_macroexpand_list (cddr u)))))
  2197. (de s!:expandfletvars (b) (cons (car b) (cons (cadr b) (
  2198. s!:fully_macroexpand_list (cddr b)))))
  2199. (de s!:expandlabels (u) (s!:expandflet u))
  2200. (de s!:expandmacrolet (u) (s!:expandflet u))
  2201. (de s!:expandprog (u) (cons (car u) (cons (cadr u) (s!:fully_macroexpand_list
  2202. (cddr u)))))
  2203. (de s!:expandtagbody (u) (s!:fully_macroexpand_list u))
  2204. (de s!:expandprogv (u) (cons (car u) (cons (cadr u) (cons (caddr u) (
  2205. s!:fully_macroexpand_list (cadddr u))))))
  2206. (de s!:expandblock (u) (cons (car u) (cons (cadr u) (
  2207. s!:fully_macroexpand_list (cddr u)))))
  2208. (de s!:expanddeclare (u) u)
  2209. (de s!:expandlet (u) (cons (car u) (cons (prog (var1196 var1197) (setq
  2210. var1196 (cadr u)) lab1195 (if (null var1196) (return (reversip var1197))) (
  2211. prog (x) (setq x (car var1196)) (setq var1197 (cons (
  2212. s!:fully_macroexpand_list x) var1197))) (setq var1196 (cdr var1196)) (go
  2213. lab1195)) (s!:fully_macroexpand_list (cddr u)))))
  2214. (de s!:expandlet!* (u) (s!:expandlet u))
  2215. (de s!:expandgo (u) u)
  2216. (de s!:expandreturn!-from (u) (cons (car u) (cons (cadr u) (
  2217. s!:fully_macroexpand_list (cddr u)))))
  2218. (de s!:expandcond (u) (cons (car u) (prog (var1199 var1200) (setq var1199 (
  2219. cdr u)) lab1198 (if (null var1199) (return (reversip var1200))) (prog (x) (
  2220. setq x (car var1199)) (setq var1200 (cons (s!:fully_macroexpand_list x)
  2221. var1200))) (setq var1199 (cdr var1199)) (go lab1198))))
  2222. (de s!:expandcase (u) (cons (car u) (cons (s!:fully_macroexpand (cadr u)) (
  2223. prog (var1202 var1203) (setq var1202 (cddr u)) lab1201 (if (null var1202) (
  2224. return (reversip var1203))) (prog (x) (setq x (car var1202)) (setq var1203 (
  2225. cons (cons (car x) (s!:fully_macroexpand_list (cdr x))) var1203))) (setq
  2226. var1202 (cdr var1202)) (go lab1201)))))
  2227. (de s!:expandeval!-when (u) (cons (car u) (cons (cadr u) (
  2228. s!:fully_macroexpand_list (cddr u)))))
  2229. (de s!:expandthe (u) (cons (car u) (cons (cadr u) (s!:fully_macroexpand_list
  2230. (cddr u)))))
  2231. (de s!:expandmv!-call (u) (cons (car u) (cons (cadr u) (
  2232. s!:fully_macroexpand_list (cddr u)))))
  2233. (put (quote function) (quote s!:expandfn) (function s!:expandfunction))
  2234. (put (quote flet) (quote s!:expandfn) (function s!:expandflet))
  2235. (put (quote labels) (quote s!:expandfn) (function s!:expandlabels))
  2236. (put (quote macrolet) (quote s!:expandfn) (function s!:expandmacrolet))
  2237. (put (quote prog) (quote s!:expandfn) (function s!:expandprog))
  2238. (put (quote tagbody) (quote s!:expandfn) (function s!:expandtagbody))
  2239. (put (quote progv) (quote s!:expandfn) (function s!:expandprogv))
  2240. (put (quote !~block) (quote s!:expandfn) (function s!:expandblock))
  2241. (put (quote declare) (quote s!:expandfn) (function s!:expanddeclare))
  2242. (put (quote !~let) (quote s!:expandfn) (function s!:expandlet))
  2243. (put (quote let!*) (quote s!:expandfn) (function s!:expandlet!*))
  2244. (put (quote go) (quote s!:expandfn) (function s!:expandgo))
  2245. (put (quote return!-from) (quote s!:expandfn) (function s!:expandreturn!-from
  2246. ))
  2247. (put (quote cond) (quote s!:expandfn) (function s!:expandcond))
  2248. (put (quote case) (quote s!:expandfn) (function s!:expandcase))
  2249. (put (quote eval!-when) (quote s!:expandfn) (function s!:expandeval!-when))
  2250. (put (quote the) (quote s!:expandfn) (function s!:expandthe))
  2251. (put (quote multiple!-value!-call) (quote s!:expandfn) (function
  2252. s!:expandmv!-call))
  2253. (de compile (l) (prog nil (if (and (atom l) (not (null l))) (setq l (list l))
  2254. ) (prog (var1205) (setq var1205 l) lab1204 (if (null var1205) (return nil)) (
  2255. prog (name) (setq name (car var1205)) (errorset (list (quote s!:compile0) (
  2256. mkquote name)) t t)) (setq var1205 (cdr var1205)) (go lab1204)) (return l)))
  2257. % end of file