next | previous | forward | backward | up | top | index | toc | home

Print -- top level method for printing results

Synopsis

Description

The function f is responsible for printing the output prompt and for applying the BeforePrint and AfterPrint methods, if desired.

Examples

i1 : code Thing.Print

o1 = -- ../../../../Macaulay2/m2/robust.m2:130-144
     Thing.Print = x -> (
          oprompt := concatenate(interpreterDepth:"o", toString lineNumber, " = ");
          save := printWidth;
          if printWidth != 0 then printWidth = printWidth - #oprompt;
          z := robustNet x;
          printWidth = save;
          wrapper := lookup(symbol Wrap,class x);
          if wrapper =!= null then (
               fun := () -> z = wrapper z;
               try timelimit(printingTimeLimit, fun) else (
                    alarm 0;
                    global debugError <- fun;
                    stderr << "--error or time limit reached in applying Wrap method to output; type 'debugError()' to see it" << endl << endl));
          << endl << oprompt << z << endl;
          )

For the programmer

The object Print is a symbol.