temporary-emode-fixes.red 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. %
  2. % TEMPORARY-EMODE-FIXES.RED - Tempory "fixes" to PSL to allow EMODE to run.
  3. %
  4. % Author: William F. Galway
  5. % Symbolic Computation Group
  6. % Computer Science Dept.
  7. % University of Utah
  8. % Date: 8 June 1982
  9. % Copyright (c) 1982 University of Utah
  10. %
  11. % This file tends to overlap CUSTOMIZE-RLISP-FOR-EMODE.RED.
  12. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  13. % Measurement tools
  14. fluid '(cons_count);
  15. Symbolic Procedure counting_cons(x,y);
  16. % Version of cons that counts each call, old_cons_function must be set up
  17. % for this to work.
  18. <<
  19. cons_count := cons_count + 1;
  20. old_cons_function(x,y)
  21. >>;
  22. Symbolic Procedure start_cons_count();
  23. % Setup to count conses. Replaces cons with a version that counts calls to
  24. % itself.
  25. begin scalar !*RedefMSG;
  26. % !*RedefMSG is a fluid, controls printing of "redefined" messages.
  27. cons_count := 0;
  28. !*RedefMSG := NIL;
  29. CopyD('old_cons_function, 'cons);
  30. CopyD('cons, 'counting_cons);
  31. end;
  32. Symbolic Procedure stop_cons_count();
  33. % Stop "cons counting", return the count.
  34. begin scalar !*RedefMSG;
  35. % !*RedefMSG is a fluid, controls printing of "redefined" messages.
  36. !*RedefMSG := NIL;
  37. CopyD('cons, 'old_cons_function);
  38. return cons_count;
  39. end;