%mathpiper,def="V;InVerboseMode"

LocalSymbols(Verbose) [

  Bind(Verbose,False);


  Function("V",{aNumberBody})
  [
    Local(prevVerbose,result);
    Bind(prevVerbose,Verbose);
    Bind(Verbose,True);
    Bind(result,Eval(aNumberBody));
    Bind(Verbose,prevVerbose);
    result;
  ];


  Function("InVerboseMode",{}) Verbose;

]; // LocalSymbols(Verbose)

HoldArgument("V",aNumberBody);
UnFence("V",1);

%/mathpiper





%mathpiper_docs,name="V;InVerboseMode",categories="User Functions;Input/Output"
*CMD V, InVerboseMode --- set verbose output mode
*STD
*CALL
	V(expression)
	InVerboseMode()

*PARMS

{expression} -- expression to be evaluated in verbose mode

*DESC

The function {V(expression)} will evaluate the expression in
verbose mode. Various parts of MathPiper can show extra information
about the work done while doing a calculation when using {V}.

In verbose mode, {InVerboseMode()} will return {True}, otherwise
it will return {False}.

*E.G. notest

In> OldSolve({x+2==0},{x})
Result: {{-2}};
In> V(OldSolve({x+2==0},{x}))
	Entering OldSolve
	From  x+2==0  it follows that  x  = -2
	   x+2==0  simplifies to  True
	Leaving OldSolve
Result: {{-2}};
In> InVerboseMode()
Result: False
In> V(InVerboseMode())
Result: True

*SEE Echo, N, OldSolve
%/mathpiper_docs