prolog.red 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. % module prolog; % system dependent code for REDUCE
  2. % Author: Anthony C. Hearn
  3. % This file defines functions, variables and declarations needed to
  4. % make REDUCE and the underlying PSL system compatible, and which need
  5. % to be input before the system independent REDUCE source is loaded.
  6. % Code for resolving aliasing name conflicts.
  7. global '(!*quotenewnam);
  8. symbolic procedure define!-alias!-list u;
  9. begin scalar x;
  10. a: if null u then return nil;
  11. x := intern compress append(explode '!~,explode car u);
  12. put(car u,'newnam,x);
  13. put(car u,'quotenewnam,x);
  14. u := cdr u;
  15. go to a
  16. end;
  17. % Support for module loading
  18. symbolic procedure load!-module u;
  19. begin scalar x;
  20. if not idp u then rederr list(u,"is not a module name");
  21. if null (x := get(u,'module!-list)) then return evload list u;
  22. a: if null x then return nil;
  23. load!-module car x;
  24. x := cdr x;
  25. go to a
  26. end;
  27. % PSL doesn't need PRINTPROMPT
  28. remflag('(printprompt),'lose);
  29. symbolic procedure printprompt u; nil;
  30. flag('(printprompt),'lose);
  31. flag('(aconc atsoc copy delasc eqcar geq lastpair leq mkquote neq prin2t
  32. reversip rplacw union xn putc yesp),'lose);
  33. flag('(block foreach lprim repeat while),'user); % permits redefinition
  34. !*quotenewnam := nil;
  35. define!-alias!-list
  36. '(arrayp do for on off logand logxor let clear flatten imports
  37. indx mkid copy mkvec vector editf spaces2 prettyprint);
  38. !*quotenewnam := t;
  39. % Resolution of non-local variable definitions.
  40. % The following PSL variables differ from the Standard LISP Report
  41. remprop('!*comp,'vartype);
  42. remprop('!*echo,'vartype);
  43. remprop('!*raise,'vartype);
  44. % The following are not in the Standard LISP Report, but differ from
  45. % usual REDUCE usage.
  46. remprop('!*output,'vartype);
  47. remprop('cursym!*,'vartype);
  48. % endmodule;
  49. end;