up previous next
indent

prints in a more readable way

Syntax
indent(X: OBJECT)
indent(X: OBJECT, N: INT)

Description
This function prints the argument X splitting it into several lines: a LIST or IDEAL is printed one element per line, a RECORD one field per line.

The second optional argument is for setting the level of recursive indentation; it is useful for example when printing a list of records.

Example
/**/ L := [1,2] >< [3,4];
/**/ L;
[[1, 3], [1, 4], [2, 3], [2, 4]]

/**/ indent(L);
[
  [1, 3],
  [1, 4],
  [2, 3],
  [2, 4]
]

/**/ indent(L,2);
[
  [
    1,
    3
  ],
    --( Further output )--
  [
    2,
    4
  ]
]

/**/ indent(record[B := 1,  A := 2]);
record[
  A := 2,
  B := 1
]

See Also