The prettyprinter
Factor handbook ยป Developer tools

Prev:Help system
Next:The inspector


One of Factor's key features is the ability to print almost any object as a valid source literal expression. This greatly aids debugging and provides the building blocks for light-weight object serialization facilities.

Prettyprinter words are found in the prettyprint vocabulary.

The key words to print an object to output-stream; the first three emit a trailing newline, the second three do not:
. ( obj -- )

... ( obj -- )

short. ( obj -- )

pprint ( obj -- )

pprint-short ( obj -- )

pprint-use ( obj -- )


The string representation of an object can be requested:
unparse ( obj -- str )

unparse-use ( obj -- str )


Utility for tabular output:
pprint-cell ( obj -- )


More prettyprinter usage:
Prettyprinting numbers
Prettyprinting stacks

Prettyprinter customization:
Prettyprint control variables
Extending the prettyprinter
Prettyprinter limitations

See also
Converting between numbers and strings, Printing definitions