Format

WMA link


Format[expr]

used on the left-hand side of an assignment to specify how expr should be printed.

First, we set up a Format definition for f to display its arguments as if it were equivalent to an infix operator "~":

Now, to see this format in use:

Raw objects cannot be formatted:

Format types must be symbols:

Formats must be attached to the head of an expression:

Format can be used to specify the request format:

Format evaluates its first element before applying the format:

but the result keeps the structure:

If the second parameter is omitted, Format is ignored:

If the second argument is not one of $PrintForms, a message is shown, and the argument is discarded:

Mathics3 Format output can differ slightly from WMA in what we hope is a more useful way.

Use InputForm if you want to get a Format definition that can be used as Mathics3 input:

In WMA, you might not get something that can be used as input.

Similarly, use Fullform to get a valid FullForm equivalent expression:

Center
Grid