

%mathpiper_docs,name="quit;restart",categories="User Functions;Built In"
*CMD quit --- stop MathPiper from running (from the command line)
*CMD restart --- restart MathPiper (to start with a clean slate)
*CORE
*CALL
	quit
	restart

*DESC

Type {quit} or {restart} at the MathPiper prompt to exit or to restart the interpreter.

The directives {quit} and {restart} are <i>not</i> reserved words or variable names.
They take effect only when typed as first characters at a prompt.

Pressing {Ctrl-C} will stop the currently running calculation.
If there is no currently running calculation, {Ctrl-C} will quit the interpreter.

When the interpreter quits, it saves the command history
(so quitting by {Ctrl-C} does not mean a "crash").

This command is not a function but a special directive that only applies while running MathPiper interactively.  It should not be used in scripts.

*E.G.

To be effective, the directive must be typed immediately after the prompt:
In> quit
	Quitting...
We can use variables named {quit}:
In> 1+quit
Result: quit+1;
There is no effect if we type some spaces first:
In>       restart
Result: restart;

*SEE Exit
%/mathpiper_docs




%mathpiper_docs,name="%_v2",categories="Operators"
*CMD % --- previous result
*CORE
*CALL
	%

*DESC

{%} evaluates to the previous result on the command line. {%} is a global
variable that is bound to the previous result from the command line.
Using {%} will evaluate the previous result. (This uses the functionality
offered by the {SetGlobalLazyVariable} command).

Typical examples are {Simplify(%)} and {PrettyForm(%)} to simplify and show the result in a nice
form respectively.

*E.G.

In> Taylor(x,0,5)Sin(x)
Result: x-x^3/6+x^5/120;
In> PrettyForm(%)

	     3    5
	    x    x
	x - -- + ---
	    6    120



*SEE SetGlobalLazyVariable
%/mathpiper_docs






%mathpiper_docs,name="True;False",categories="User Functions;Constants (System)"
*CMD True --- boolean constant representing true
*CMD False --- boolean constant representing false
*CORE
*CALL
	True
	False

*DESC

{True} and {False} are typically a result
of boolean expressions such as {2 < 3} or {True And False}.

*SEE And, Or, Not
%/mathpiper_docs






%mathpiper_docs,name="EndOfFile",categories="User Functions;Constants (System)"
*CMD EndOfFile --- end-of-file marker
*CORE
*CALL
	EndOfFile

*DESC

End of file marker when reading from file. If a file
contains the expression {EndOfFile;} the
operation will stop reading the file at that point.
%/mathpiper_docs





%mathpiper_docs,name="Infinity",categories="User Functions;Constants (Mathematical)"

*CMD Infinity --- constant representing mathematical infinity
*STD
*CALL
	Infinity

*DESC

Infinity represents infinitely large values. It can be the result of certain
calculations.

Note that for most analytic functions MathPiper understands {Infinity} as a positive number.
Thus {Infinity*2} will return {Infinity}, and {a < Infinity} will evaluate to {True}.

*E.G.

In> 2*Infinity
Result: Infinity;
In> 2<Infinity
Result: True;
%/mathpiper_docs





%mathpiper_docs,name="Undefined",categories="User Functions;Constants (Mathematical)"
*CMD Undefined --- constant signifying an undefined result
*STD
*CALL
	Undefined

*DESC

{Undefined} is a token that can be returned by a function when it considers
its input to be invalid or when no meaningful answer can be given. The result is then "undefined".

Most functions also return {Undefined} when evaluated on it.

*E.G.

In> 2*Infinity
Result: Infinity;
In> 0*Infinity
Result: Undefined;
In> Sin(Infinity);
Result: Undefined;
In> Undefined+2*Exp(Undefined);
Result: Undefined;

*SEE Infinity
%/mathpiper_docs




%mathpiper_docs,name="/*;*/;//",categories="Operators"
*CMD	/* --- Start of comment
*CMD	*/ --- end of comment
*CMD	// --- Beginning of one-line comment
*CORE
*CALL
	/* comment */
	// comment

*DESC

Introduce a comment block in a source file, similar to C++ comments.
{//} makes everything until the end of the line a comment, while {/*} and {*/} may delimit a multi-line comment.

*E.G.

	a+b; // get result
	a + /* add them */ b;
%/mathpiper_docs




%mathpiper_docs,name="[;]",categories="Operators"
*CMD [ --- beginning of block of statements
*CMD ] --- end of block of statements
*CORE
*CALL

	[ statement1; statement2; ... ]

*PARMS

{statement1}, {statement2} -- expressions

*DESC

The {Prog} and the {[ ... ]} construct have the same effect: they evaluate all
arguments in order and return the result of the last evaluated expression.

{Prog(a,b);} is the same as typing {[a;b;];} and is very useful for writing out
function bodies. The {[ ... ]} construct is a syntactically nicer version of the
{Prog} call; it is converted into {Prog(...)} during the parsing stage.

*SEE Prog
%/mathpiper_docs