cslrend.red 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633
  1. module cslrend; % CSL REDUCE "back-end".
  2. % Authors: Martin L. Griss and Anthony C. Hearn.
  3. % Modified by Arthur Norman for use with CSL.
  4. create!-package('(cslrend autopatch csl),nil);
  5. fluid '(!*break
  6. !*echo
  7. !*eolinstringok
  8. !*int
  9. !*mode
  10. !*raise
  11. !*lower
  12. !*keepsqrts);
  13. global '(!$eol!$
  14. !*extraecho
  15. cr!*
  16. crchar!*
  17. date!*
  18. esc!*
  19. ff!*
  20. ifl!*
  21. ipl!*
  22. largest!-small!-modulus
  23. lispsystem!*
  24. ofl!*
  25. spare!*
  26. statcounter
  27. crbuflis!*
  28. tab!*
  29. version!*
  30. copyright1!*
  31. copyright2!*
  32. loadable!-packages!*
  33. switches!*
  34. symchar!*);
  35. copyright1!* := "Copyright A C Hearn, 2004";
  36. copyright2!* := "Copyright Codemist Ltd, 2004";
  37. loadable!-packages!* := '(
  38. algint applysym arnum assist atensor
  39. avector boolean cali camal cantens
  40. cedit cgb changevr cl compact
  41. conlaw crack cvit defint desir
  42. dfpart dummy dvfsf eds excalc
  43. ezgcd factor fide fmprint fps
  44. ftr gentran geoprover ghyper gnuplot
  45. groebner hephys ideals ineq int
  46. invbase laplace lie liepde limits
  47. linalg mathml matrix meijerg misc
  48. modsr mrvlimit ncpoly normform numeric
  49. odesolve ofsf orthovec pf physop
  50. plot pm polydiv pretty qsum
  51. randpoly rataprx ratint rcref reacteqn
  52. redlog reset residue rlfi rlisp88
  53. rltools roots rprint rsolve rtrace
  54. scope sets sfgamma solve sparse
  55. spde specfn sum support susy2
  56. symmetry taylor tps tri trigint
  57. trigsimp wu xcolor xideal zeilberg
  58. ztrans);
  59. % This amazingly long list of switches was created as a by-product
  60. % of building the bootstrap version of Reduce 3.8. In that build use of
  61. % the directive that introduces switches is logged. Not all of these switches
  62. % are really aimed at the general public, and almost all only apply when
  63. % some particular module is loaded.
  64. switches!* := '(
  65. acinfo adjprec again algint algpri
  66. allbranch allfac allowdfint allpoly anticom
  67. arbvars arnum asterisk backtrace balanced_mod
  68. balanced_was_on batch_mode bcsimp bezout bfspace
  69. boese both carcheckflag carefuleq centergrid
  70. cgbcheckg cgbcontred cgbcounthf cgbfullred cgbgen
  71. cgbgs cgbreal cgbsgreen cgbstat cgbupdb
  72. cgbverbose coates combineexpt combinelogs commutedf
  73. commuteint comp complex compxroots contract
  74. cramer cref cvit debug debug_times
  75. defn demo derexp detectunits dfint
  76. dfprint diffsoln dispjacobian distribute div
  77. double downcase dummypri echo edsdebug
  78. edsdisjoint edssloppy edsverbose eqfu errcont
  79. essl evallhseqp exdelt exp expanddf
  80. expandexpt expandlogs ezgcd f90 factor
  81. factorprimes factorunits failhard fancy fancy_tex
  82. fast_la fastfor faststructs fastvector force
  83. fort fortupper fourier ftch fulleq
  84. fullpoly fullprec fullprecision fullroots gbltbasis
  85. gc gcd gendecs genpos gentranopt
  86. gentranseg getdecs gltbasis groebfac groebfullreduction
  87. groebopt groebprot groebrm groebstat groebweak
  88. gsugar hardzerotest heugcd horner hyperbolic
  89. ifactor imaginary imsl inputc int
  90. int_test intern intstr keepdecs lasimp
  91. latex lcm lessspace lexefgb lhyp
  92. limitedfactors list listargs lmon looking_good
  93. lower lower_matrix ltrig makecalls mathml
  94. mcd mod_was_on modular msg multiplicities
  95. multiroot mymatch nag nat nero
  96. nested noacn noarg nocommutedf nocompile
  97. noconvert noetherian noint nointint nolnr
  98. nonlnr nopowers nosplit nosturm not_negative
  99. notailcall novarmsg numval odesolve_basis odesolve_check
  100. odesolve_diff odesolve_equidim_y odesolve_expand odesolve_explicit odesolve_fast
  101. odesolve_full odesolve_implicit odesolve_noint odesolve_norecurse odesolve_noswap
  102. odesolve_simp_arbparam odesolve_verbose onespace only_integer optdecs
  103. ord outerzeroscheck output overview partialint
  104. partialintdf partialintint period pgwd plap
  105. plotkeep plotusepipe prapprox precise prefix
  106. pret prfourmat pri priall primat
  107. prlinineq psen pvector pwrds qgosper_down
  108. qgosper_specials qsum_nullspace qsum_trace qsumrecursion_certificate qsumrecursion_down
  109. qsumrecursion_exp qsumrecursion_profile quotenewnam r2i raise
  110. ranpos rat ratarg rational rationalize
  111. ratpri ratroot red_total reduce4 reduced
  112. revpri rladdcond rlanuexdebug rlanuexdifferentroots rlanuexgcdnormalize
  113. rlanuexpsremseq rlanuexsgnopt rlanuexverbose rlbnfsac rlbnfsm
  114. rlbrop rlcadaproj rlcadaprojalways rlcadbaseonly rlcaddebug
  115. rlcaddecdeg rlcaddnfformula rlcadextonly rlcadfac rlcadfasteval
  116. rlcadfulldimonly rlcadhongproj rlcadisoallroots rlcadmc3 rlcadmcproj
  117. rlcadpartial rlcadpbfvs rlcadpreponly rlcadprojonly rlcadrawformula
  118. rlcadte rlcadtrimtree rlcadverbose rldavgcd rlgsbnf
  119. rlgserf rlgsprod rlgsrad rlgsred rlgssub
  120. rlgsutord rlgsvb rlidentify rlisp88 rlnzden
  121. rlopt1s rlourdet rlparallel rlposden rlpscsgen
  122. rlqedfs rlqefb rlqegen1 rlqegenct rlqegsd
  123. rlqeheu rlqepnf rlqeqsc rlqesqsc rlqesr
  124. rlqevarsel rlrealtime rlsiatadv rlsichk rlsiexpl
  125. rlsiexpla rlsifac rlsiidem rlsimpl rlsipd
  126. rlsipo rlsipw rlsism rlsiso rlsitsqspl
  127. rlsusi rlsusiadd rlsusigs rlsusimult rltabib rltnft
  128. rlverbose rlvmatvb rlxopt rlxoptpl rlxoptri
  129. rlxoptric rlxoptrir rlxoptsb rlxoptses rootmsg
  130. roundall roundbf rounded rtrace saveactives
  131. savedef savesfs savestructr semantic sfto_musser
  132. sfto_tobey sfto_yun show_grid sidrel simpnoncomdf
  133. solvesingular symmetric taylorautocombine taylorautoexpand taylorkeeporiginal
  134. taylornocache taylorprintorder tdusetorder tensor test_plot
  135. testecho tex texbreak texindent time
  136. tr_lie tra tracefps tracelimit traceratint
  137. tracespecfns tracetrig trallfac trchrstrem trcompact
  138. trdesir trdint trfac trfield trgroeb
  139. trgroeb1 trgroebr trgroebs trham trigform
  140. trint trinvbase trlinineq trlinineqint trlinrec
  141. trmin trnonlnr trnumeric trode trplot
  142. trpm trroot trsolve trsum trtaylor
  143. trwu trxideal trxmod twogrid twosided
  144. unsafecar upcase upper_matrix useold usetaylor
  145. usez varopt vectorc verbatim verboseload
  146. vtrace web windexpri wrchri xfullreduce
  147. xpartialint xpartialintdf xpartialintint zb_factor zb_inhomogeneous
  148. zb_proof zb_timer zb_trace zeilberg);
  149. % Constants used in scanner.
  150. flag('(define!-constant),'eval);
  151. cr!* := compress(list('!!, special!-char 6)); % carriage return
  152. ff!* := compress(list('!!, special!-char 5)); % form feed
  153. tab!*:= compress(list('!!, special!-char 3)); % tab key
  154. % One inessential reference to REVERSIP in this module (left unchanged).
  155. % This file defines the system dependent code necessary to run REDUCE
  156. % under CSL.
  157. Comment The following functions, which are referenced in the basic
  158. REDUCE source (RLISP, ALG1, ALG2, MATR and PHYS) should be defined to
  159. complete the definition of REDUCE:
  160. BYE
  161. EVLOAD
  162. ERROR1
  163. FILETYPE
  164. MKFIL
  165. ORDERP
  166. QUIT
  167. SEPRP
  168. SETPCHAR.
  169. Prototypical descriptions of these functions are as follows;
  170. remprop('bye,'stat);
  171. symbolic procedure bye;
  172. %Returns control to the computer's operating system command level.
  173. %The current REDUCE job cannot be restarted;
  174. <<close!-output!-files(); stop 0>>;
  175. deflist('((bye endstat)),'stat);
  176. remprop('quit,'stat);
  177. symbolic procedure quit;
  178. %Returns control to the computer's operating system command level.
  179. %The current REDUCE job cannot be restarted;
  180. <<close!-output!-files(); stop 0>>;
  181. deflist('((quit endstat)),'stat);
  182. % evload is now defined in cslprolo.red - this has to be the case
  183. % so it can be used (via load_package) to load rlisp and cslrend.
  184. % symbolic procedure evload l;
  185. % for each m in l do load!-module m;
  186. symbolic procedure seprp u;
  187. % Returns true if U is a blank, end-of-line, tab, carriage return or
  188. % form feed. This definition replaces the one in the BOOT file.
  189. u eq '! or u eq tab!* or u eq !$eol!$ or u eq ff!* or u eq cr!*;
  190. symbolic procedure filetype u;
  191. % Determines if string U has a specific file type.
  192. begin scalar v,w;
  193. v := cdr explode u;
  194. while v and not(car v eq '!.) do
  195. <<if car v eq '!< then while not(car v eq '!>) do v := cdr v;
  196. v := cdr v>>;
  197. if null v then return nil;
  198. v := cdr v;
  199. while v and not(car v eq '!") do <<w := car v . w; v := cdr v>>;
  200. return intern compress reversip w
  201. end;
  202. symbolic procedure mkfil u;
  203. % Converts file descriptor U into valid system filename.
  204. if stringp u then u
  205. else if not idp u then typerr(u,"file name")
  206. else string!-downcase u;
  207. Comment The following functions are only referenced if various flags are
  208. set, or the functions are actually defined. They are defined in another
  209. module, which is not needed to build the basic system. The name of the
  210. flag follows the function name, enclosed in parentheses:
  211. CEDIT (?)
  212. COMPD (COMP)
  213. EDIT1 This function provides a link to an editor. However, a
  214. definition is not necessary, since REDUCE checks to see
  215. if it has a function value.
  216. EMBFN (?)
  217. EZGCDF (EZGCD)
  218. PRETTYPRINT (DEFN --- also called by DFPRINT)
  219. This function is used in particular for output of RLISP
  220. expressions in LISP syntax. If that feature is needed,
  221. and the prettyprint module is not available, then it
  222. should be defined as PRINT
  223. RPRINT (PRET)
  224. TIME (TIME) returns elapsed time from some arbitrary initial
  225. point in milliseconds;
  226. Comment The following operator is used to save a REDUCE session as a
  227. file for later use;
  228. symbolic procedure savesession u;
  229. preserve('begin);
  230. flag('(savesession),'opfn);
  231. flag('(savesession),'noval);
  232. Comment make "system" available as an operator;
  233. flag('(system),'opfn);
  234. flag('(system),'noval);
  235. Comment to make "faslend" an endstat;
  236. put('faslend,'stat,'endstat);
  237. Comment The current REDUCE model allows for the availability of fast
  238. arithmetical operations on small integers (called "inums"). All modern
  239. LISPs provide such support. However, the program will still run without
  240. these constructs. The relevant functions that should be defined for
  241. this purpose are as follows;
  242. flag('(iplus itimes iplus2 itimes2 iadd1 isub1 iminus iminusp
  243. idifference iquotient iremainder ilessp igreaterp ileq igeq
  244. izerop ionep), 'lose);
  245. Comment There are also a number of system constants required for each
  246. implementation. In systems that don't support inums, the equivalent
  247. single precision integers should be used;
  248. % LARGEST!-SMALL!-MODULUS is the largest power of two that can
  249. % fit in the fast arithmetic (inum) range of the implementation.
  250. % This is constant for the life of the system and could be
  251. % compiled in-line if the compiler permits it.
  252. largest!-small!-modulus := 2**24 - 1; % I could use up to 2^27-1, but
  253. % stick to 2^24-1 since that's what Cambridge Lisp used to use.
  254. flag('(modular!-difference modular!-minus modular!-number
  255. modular!-plus modular!-quotient modular!-reciprocal
  256. modular!-times modular!-expt set!-small!-modulus), 'lose);
  257. % See comments about gensym() below - which apply also to the
  258. % effects of having different random number generators in different
  259. % host Lisp systems.
  260. % From 3.5 onwards (with a new random generator built into the
  261. % REDUCE sources) I am happy to use the portable version.
  262. % flag('(random next!-random!-number), 'lose);
  263. set!-small!-modulus 3;
  264. % The following are now built into CSL, where by using the C library
  265. % and (hence?) maybe low level tricks or special floating point
  266. % microcode things can go fast.
  267. flag('(acos acosd acosh acot acotd acoth acsc acscd acsch asec asecd
  268. asech asin asind asinh atan atand atan2 atan2d atanh cbrt cos
  269. cosd cosh cot cotd coth csc cscd csch exp expt hypot ln log
  270. logb log10 sec secd sech sin sind sinh sqrt tan tand tanh fix
  271. ceiling floor round clrhash puthash gethash remhash), 'lose);
  272. % remflag('(int!-gensym1),'lose);
  273. % symbolic procedure int!-gensym1 u;
  274. % In Codemist Lisp compress interns - hence version in int.red may
  275. % not work. However, it seems to be ok for now.
  276. % gensym1 u;
  277. % flag('(int!-gensym1),'lose);
  278. global '(loaded!-packages!* no!_init!_file personal!-dir!*);
  279. personal!-dir!* := "$HOME";
  280. symbolic procedure load!-patches!-file;
  281. begin scalar !*redefmsg,file,x; % Avoid redefinition messages.
  282. if memq('demo, lispsystem!*) then return;
  283. if filep(file := concat(personal!-dir!*,"/patches.fsl")) then nil
  284. else if filep(file :=
  285. concat(get!-lisp!-directory(),"/patches.fsl"))
  286. then nil
  287. else return nil;
  288. x := binopen(file,'input);
  289. for i := 1:16 do readb x; % Skip checksum stuff.
  290. load!-module x; % Load patches.
  291. close x;
  292. if patch!-date!*
  293. then startup!-banner concat(version!*,concat(", ",concat(date!*,
  294. concat(", patched to ",concat(patch!-date!*," ...")))));
  295. for each m in loaded!-packages!* do
  296. if (x := get(m,'patchfn)) then apply(x,nil)
  297. end;
  298. % For compatibility with older versions.
  299. symbolic procedure load!-latest!-patches;
  300. load!-patches!-file();
  301. Comment We need to define a function BEGIN, which acts as the top-level
  302. call to REDUCE, and sets the appropriate variables;
  303. remflag('(begin),'go);
  304. symbolic procedure begin;
  305. begin
  306. scalar w,!*redefmsg;
  307. !*echo := not !*int;
  308. !*extraecho := t;
  309. % If invoked from texmacs do something special...
  310. if modulep 'tmprint and member('texmacs, lispsystem!*) then <<
  311. w := verbos 0;
  312. load!-module 'tmprint;
  313. fmp!-switch t;
  314. off1 'promptnumbers;
  315. verbos w >>
  316. % If the tmprint module is loaded and I have a window that can support it
  317. % I will display things in a "fancy" way within the CSL world.
  318. else if getd 'fmp!-switch then
  319. fmp!-switch member('showmath, lispsystem!*);
  320. ifl!* := ipl!* := ofl!* := nil;
  321. if date!* then <<
  322. verbos nil;
  323. % The linelength may need to be adjusted if we are running in a window.
  324. % To cope with this, CSL allows (linelength t) to set a "default" line
  325. % length that can even vary as window sizes are changed. An attempt
  326. % will be made to ensure that it is 80 at the start of a run, but
  327. % (linelength nil) can return varying values as the user re-sizes the
  328. % main window (in some versions of CSL). However this is still not
  329. % perfect! The protocol
  330. % old := linelength nil;
  331. % <do something, possibly changing linelength as you go>
  332. % linelength old;
  333. % can not restore the variability characteristic. However I make
  334. % old := linelength n; % n numeric or T
  335. % ...
  336. % linelength old;
  337. % preserve things by returning T from (linelength n) in relevant cases.
  338. linelength t;
  339. % The next four lines have been migrated into the C code in "restart.c"
  340. % so that some sort of information gets back to the user nice and early.
  341. % prin2 version!*;
  342. % prin2 ", ";
  343. % prin2 date!*;
  344. % prin2t " ...";
  345. if getd 'addsq then <<
  346. % I assume here that this is an algebra system if ADDSQ is defined, and
  347. % in that case process an initialisation file. Starting up without ADDSQ
  348. % defined means I either have just RLISP built or I am in the middle of
  349. % some bootstrap process. Also if a variable no_init_file is set to TRUE
  350. % then I avoid init file processing.
  351. !*mode := 'algebraic;
  352. if null no!_init!_file then begin
  353. scalar name;
  354. name := assoc('shortname, lispsystem!*);
  355. if atom name then name := "reduce"
  356. else name := list!-to!-string explode2lc cdr name;
  357. erfg!* := nil;
  358. read!-init!-file name end >>
  359. else !*mode := 'symbolic;
  360. % date!* := nil;
  361. >>;
  362. % If there is a patches module that is later than one that I currently
  363. % have installed then load it up now.
  364. if version!* neq "REDUCE Development Version"
  365. then load!-patches!-file();
  366. w := assoc('opsys, lispsystem!*);
  367. if not atom w then w := cdr w;
  368. % For MOST systems I will let ^G (bell) be the escape character, but
  369. % under win32 I use that as an interrupt character, and so there I go
  370. % back and use ESC instead. I do the check at BEGIN time rather than
  371. % further out so that common checkpoint images can be used across
  372. % systems.
  373. esc!*:= compress list('!!,
  374. special!-char (if w = 'win32 then 10 else 9));
  375. while errorp errorset('(begin1), !*backtrace, !*backtrace) do nil;
  376. prin2t "Leaving REDUCE ... "
  377. end;
  378. flag('(begin),'go);
  379. % The following function is used in some CSL-specific operations. It is
  380. % also defined in util/rprint, but is repeated here to avoid loading
  381. % that module unnecessarily, and because the definition given there is
  382. % rather PSL specific.
  383. remflag('(string!-downcase),'lose);
  384. symbolic procedure string!-downcase u;
  385. compress('!" . append(explode2lc u,'(!")));
  386. % princ!-upcase and princ!-downcase are used for fortran output
  387. flag('(string!-downcase princ!-upcase princ!-downcase),'lose);
  388. % This function is used in Rlisp '88.
  389. symbolic procedure igetv(u,v); getv(u,v);
  390. symbolic procedure iputv(u,v,w); putv(u,v,w);
  391. % The following functions are NOT in Standard Lisp and should NOT be
  392. % used anywhere in the REDUCE sources, but the amount of trouble I have
  393. % had with places where they do creep in has encouraged me to define
  394. % them here anyway and put up with the (small) waste of space.
  395. symbolic procedure first x; car x;
  396. symbolic procedure second x; cadr x;
  397. symbolic procedure third x; caddr x;
  398. symbolic procedure fourth x; cadddr x;
  399. symbolic procedure rest x; cdr x;
  400. Comment Initial setups for REDUCE;
  401. spare!* := 0; % We need this for bootstrapping.
  402. symchar!* := t; % Changed prompt when in symbolic mode.
  403. % PSL has gensyms with names g0001, g0002 etc., and in a few places
  404. % REDUCE will insert gensyms into formulae in such a way that their
  405. % names can influence the ordering of terms. The next fragment of
  406. % commented out code make CSL use similar names (but interned). This
  407. % is not sufficient to guarantee a match with PSL though, since in (for
  408. % instance) the code
  409. % list(gensym(), gensym(), gensym())
  410. % there is no guarantee which gensym will have the smallest serial
  411. % number. Also if !*comp is true and the user defines a procedure it is
  412. % probable that the compiler does a number (just how many we do not
  413. % wish to say) of calls to gensym, upsetting the serial number
  414. % sequence. Thus other ways of ensuring consistent output from REDUCE
  415. % are needed.
  416. %- global '(gensym!-counter);
  417. %- gensym!-counter := 1;
  418. %- symbolic procedure reduce!-gensym();
  419. %- begin
  420. %- scalar w;
  421. %- w := explode gensym!-counter;
  422. %- gensym!-counter := gensym!-counter+1;
  423. %- while length w < 4 do w := '!0 . w;
  424. %- return compress ('g . w)
  425. %- end;
  426. %- remflag('(gensym), 'lose);
  427. %- remprop('gensym, 's!:builtin0);
  428. %- smacro procedure gensym();
  429. %- reduce!-gensym();
  430. % However, the current CSL gensym uses an upper case G as the root,
  431. % which causes inconsistencies in some tests (e.g., int and qsum).
  432. % This definition cures that.
  433. symbolic smacro procedure gensym; gensym1 'g;
  434. symbolic procedure initreduce;
  435. initrlisp(); % For compatibility.
  436. symbolic procedure initrlisp;
  437. % Initial declarations for REDUCE
  438. <<statcounter := 0;
  439. %- gensym!-counter := 1;
  440. crbuflis!* := nil;
  441. spare!* := 0;
  442. % !*int := not batchp();
  443. !*int := t;
  444. >>;
  445. symbolic procedure rlispmain;
  446. lispeval '(begin);
  447. flag('(rdf preserve reclaim),'opfn);
  448. flag('(rdf preserve),'noval);
  449. flag('(load reload),'noform);
  450. deflist('((load rlis) (reload rlis)),'stat);
  451. symbolic macro procedure load x; PSL!-load(cdr x, nil);
  452. symbolic macro procedure reload x; PSL!-load(cdr x, t);
  453. global '(PSL!-loaded!*);
  454. PSL!-loaded!* := nil;
  455. symbolic procedure PSL!-load(mods, reloadp);
  456. for each x in mods do <<
  457. if reloadp or not member(x, PSL!-loaded!*) then <<
  458. % load!-module x;
  459. load!-package x;
  460. PSL!-loaded!* := union(list x, PSL!-loaded!*) >> >>;
  461. symbolic macro procedure tr x;
  462. list('trace, list('quote, cdr x));
  463. symbolic macro procedure untr x;
  464. list('untrace, list('quote, cdr x));
  465. symbolic macro procedure trst x;
  466. list('traceset, list('quote, cdr x));
  467. symbolic macro procedure untrst x;
  468. list('untraceset, list('quote, cdr x));
  469. flag('(tr untr
  470. trst untrst
  471. ),'noform);
  472. deflist('((tr rlis) (trst rlis)
  473. (untr rlis) (untrst rlis)
  474. ),'stat);
  475. symbolic procedure prop x; plist x; % Yukky PSL compatibility.
  476. Comment The following declarations are needed to build various modules;
  477. flag('(mkquote spaces subla boundp error1),'lose);
  478. % The exact order of items in the lists produced by these is important
  479. % to REDUCE.
  480. flag('(union intersection), 'lose);
  481. flag('(safe!-fp!-plus safe!-fp!-times safe!-fp!-quot
  482. % safe!-fp!-pl safe!-fp!-pl0
  483. ), 'lose);
  484. flag('(threevectorp ordp), 'lose);
  485. deflist('((imports rlis)),'stat);
  486. flag('(sort stable!-sort stable!-sortip),'lose);
  487. % We also need this.
  488. flag('(lengthc),'lose);
  489. symbolic procedure concat2(u,v); concat(u,v);
  490. symbolic procedure concat(u,v);
  491. % This would be better supported at a lower level.
  492. compress('!" . append(explode2 u,nconc(explode2 v,list '!")));
  493. % Used by patching mechanism.
  494. %
  495. % Note that DESPITE the name this MUST be an interned symbol not a
  496. % gensym since it will be used as the name of a function written out
  497. % using FASLOUT and later re-loaded: gensym identities can not survive
  498. % this transition. The symbols created by dated!-name are almost
  499. % always going to avoid clashes - see commentary in the CSL source file
  500. % "extras.red" for an explanation.
  501. symbolic procedure dated!-gensym u; dated!-name u;
  502. endmodule;
  503. end;