cont-error.red 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. %
  2. % CONT-ERROR.RED - Nice macro to set up arguments for ContinuableError
  3. %
  4. % Author: Eric Benson
  5. % Symbolic Computation Group
  6. % Computer Science Dept.
  7. % University of Utah
  8. % Date: 23 August 1981
  9. % Copyright (c) 1981 University of Utah
  10. %
  11. % <PSL.INTERP>CONT-ERROR.RED.3, 2-Sep-82 09:10:04, Edit by BENSON
  12. % Made handling of ReEvalForm more robust
  13. % format is:
  14. % ContError(ErrorNumber, FormatString, {arguments to PrintF}, ReEvalForm)
  15. % ReEvalForm is something like
  16. % Foo(X, Y)
  17. % which becomes
  18. % list('Foo, MkQuote X, MkQuote Y)
  19. macro procedure ContError U; %. Set up for ContinuableError
  20. begin scalar ErrorNumber, Message, ReEvalForm;
  21. U := cdr U;
  22. ErrorNumber := car U;
  23. U := cdr U;
  24. if null cddr U then % if it's just a string, don't
  25. << Message := car U; % generate call to BldMsg
  26. U := cdr U >>
  27. else
  28. << while cdr U do
  29. << Message := AConc(Message, car U);
  30. U := cdr U >>;
  31. Message := 'BldMsg . Message >>;
  32. ReEvalForm := car U;
  33. ReEvalForm := if not PairP ReEvalForm then list('MkQuote, ReEvalForm)
  34. else 'list
  35. . MkQuote car ReEvalForm
  36. . for each X in cdr ReEvalForm collect list('MkQuote, X);
  37. return list('ContinuableError,
  38. ErrorNumber,
  39. Message,
  40. ReEvalForm);
  41. end;
  42. END;