Search                        Top                                  Index
HELP SYS_SYSPR                              Jonathan Laventhol, 20 March 1985


SYS_SYSPR is the system's standard printing procedure. It prints objects in
the standard format; examples shown below.

Normally, you use the procedure *PR to print things.  You can change this
procedure to do any kind of printing you want.  The default value for PR is
*SYSPR.  This uses the CLASS_PRINT field of the key of the object to decide how
to print it.  The default for this field is SYS_SYSPR.  So, unless you change
something, objects will get printed with SYS_SYSPR, like this:

    Type of Object              Printed Representation
    ---- -- ------              ------- --------------
    Procedures:                 <procedure foo>
    Vectors:                    {hello there}
    Lists:                      [hello there]
    Nil:                        []
    Strings:                    hello
    Words:                      hello
    Booleans:                   <true> or <false>
    Integers:                   123
    Decimals and Ddecimals:     123.0

All other objects print the dataword of the object, and then any "contents" of
the object, all inside angle brackets.  So, for example, a REF (which is an
object with a single field):

    <ref 8>

If you make your own data structures, they will print with the angle bracket

--- Notes ------------------------------------------------------------------

    The format for printing procedures is <procedure X> where X will be the
*RECURSIVE_FRONT of the *PDPROPS of the procedure.  This procedure:

    define foo(); ... enddefine

has the word "foo" as its PDPROPS.  Sometimes other information is kept there.

Floating point numbers normally print at least one fractional digit. Beyond
this, trailing zeroes are dropped. ('Normally' means when *POP_PR_PLACES is
bigger than zero.  See below)

--- Control Variables ------------------------------------------------------

Sometimes you might want slightly different printing of certain objects.
There are three variables which control how numbers are printed, and one for

For numbers, you can change the number of fractional digits printed, the base
of the numbers, and choose between two formats: floating point (123.023)
mantissa and exponent (1.23023e+2, ie 1.23023 * 10**2).

For strings, it is sometimes useful to have them printed with single quote
marks around them.  Then you can tell that they aren't words, and whether
there are any spaces at the end of them.  An example of this is the
"INVOLVING" line of a mishap message.

All of these variables have help files:

*POP_PR_RADIX       Controls the number base which numbers are printed in.
                    (Includes exponent for manitissa and exponent printing)

*POP_PR_EXPONENT    Controls whether floating point numbers are printing in
                    mantissa and exponent form.

*POP_PR_PLACES      Controls the number of places printed after the decimal
                    point in floating point numbers.  If zero, then no decimal

*POP_PR_QUOTES      Controls whether single quotes are printed around strings.

See also
HELP *PR         - holds as its value a printing procedure
HELP *SYSPR      - prints its argument: default value of PR

--- C.all/help/sys_syspr
--- Copyright University of Sussex 1992. All rights reserved. ----------