Project

General

Profile

Feature #1271

Allow Interruption of printing?

Added by John Abbott about 5 years ago. Updated about 5 years ago.

Status:
In Progress
Priority:
Normal
Assignee:
-
Category:
enhancing/improving
Target version:
Start date:
16 Apr 2019
Due date:
% Done:

10%

Estimated time:
Spent time:

Description

Inside emacs, if you print out a very long list then it takes ages before you can use emacs/CoCoA-5 again.

Consider allowing interruption of printing (at least for potentially large objects).


Related issues

Related to CoCoA-5 - Design #610: Variable It: assign before or after printingNew2014-09-02

History

#1 Updated by John Abbott about 5 years ago

I have a tried a first approach, but it did no work as I would have liked...

What I tried:
  • in Interpreter.C around line 2453
  • inserted CoCoA::CheckForInterrupt("Printing LIST");
  • effect: interrupt was recognized, and stopped printing, but resulted in a "catastrophic error" (process exited with code 1) after printing ***ERROR*** UNCAUGHT UNKNOWN EXCEPTION
  • printed error seems to have come from Main.C around line 354

Not sure why the exception was not caught.

#2 Updated by Anna Maria Bigatti about 5 years ago

I agree this would be very useful.
Strange for the error!

#3 Updated by John Abbott about 5 years ago

  • Description updated (diff)
  • Status changed from New to In Progress
  • % Done changed from 0 to 10
Which printing commands should allow themselves to be interrupted?
  • lists
  • matrices
  • ideals (?)
I think probably not polynomials (nor very large integers):
  • for large integers it would be tricky because they are internally converted to a string, which is then printed with a single C++ fn call
  • for polynomials we could perhaps check for interrupts between printing terms, but I am concerned that too many checks for interrupts might have a perceptible impact on speed (though the checks should be quite cheap); also note that polynomials can have a "recursive structure".

I had thought about checking for interrupts, say, every 100 terms in a poly. But then it is possible to create a large recursive polynomial where no check is made: consider (1+x+x^2+...+x^99)*(1+y+y^2+...+y^99)*(1+z+z^2+...+z^99) in the ring QQ[x][y][z].

#4 Updated by John Abbott about 4 years ago

  • Related to Design #610: Variable It: assign before or after printing added

Also available in: Atom PDF