Macaulay2 » Documentation
Packages » Macaulay2Doc » The Macaulay2 language » system facilities » top level loop » topLevelMode » Print
next | previous | forward | backward | up | index | toc

Print -- top level method for printing results

Description

The function f is responsible for printing the output prompt and for applying the BeforePrint and AfterPrint methods, if desired.
i1 : code Thing#{Standard,Print}

o1 = ${prefix}/share/Macaulay2/Core/robust.m2:133:25-149:6: --source
     code:
     Thing#{Standard,Print} = x -> (
          oprompt := concatenate(interpreterDepth:"o", toString lineNumber, " = ");
          save := printWidth;
          if printWidth != 0 then printWidth = printWidth - #oprompt;
          z := robustNet x;
          wrapper := lookup(global 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;
          printWidth = save;
          )

Menu

For the programmer

The object Print is a symbol.


The source of this document is in Macaulay2Doc/ov_repl.m2:315:0.