1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57
|
\DOC print_ibegin
\TYPE {print_ibegin : (int -> void)}
\SYNOPSIS
Initiates a pretty printing block with inconsistent breaks.
\DESCRIBE
The function {print_ibegin} initiates a inconsistent printing block.
Inconsistent breaks cause non-uniform
indentation at each break which is unlike the `all or nothing'
approach of consistent formatting (see {print_begin}). The argument is the
offset of the block that {print_ibegin} initiates. This offset is added to the
indentation of any lines broken inside. This offset is very seldom used.
\FAILURE
Never fails.
\EXAMPLE
\noindent Set the margin to be 13 characters wide:
{
#set_margin 13;;
13 : int
}
\noindent Then initialize the block using {print_ibegin}:
{
#let example =
(print_newline();
print_ibegin 0;
print_string `first`;
print_break (1,2);
print_string `second`;
print_break (1,2);
print_string `third`;
print_end();
print_newline());;
}
\noindent After the initialization of the block the strings
`first', `second' and `third' are printed with breaks between them. The first
line does not break because we only
have 12 characters on the line {first second}. When starting to print `third'
though wrapping has to take place.
\noindent The output we obtain is the following:
{
first second
third
example =
()
: void
}
\SEEALSO
print_break, print_end, max_print_depth, print_begin
\ENDDOC
|