Title: Theory / Unimportant / CS / Programming / oCaml / Library / Format
Tags: récupéré seen_description
On every note of this deck, unless a note says otherwise:
Page: https://caml.inria.fr/pub/docs/manual-ocaml/libref/Format.html/

Instruction: f.out_string
Effect: performs all the pretty-printer string output.
Language: oCaml
Variables: f a formatter_out_function
Library: Format

Instruction: f.out_flush
Effect: Flushes the pretty-printer output device.
Language: oCaml
Variables: f a formatter_out_function
Library: Format

Instruction: f.out_spaces
Effect: Outputs spaces when a break hint leads to spaces instead of a line split. It is called with the number of spaces to output.
Language: oCaml
Variables: f a formatter_out_function
Library: Format

Instruction: f.out_indent
Effect: performs new line indentation when the pretty-printer splits the line. It is called with the indentation value of the new line.
Language: oCaml
Variables: f a formatter_out_function
Library: Format

Instruction: set_formatter_out_functions f
Effect: Set all the pretty-printer output functions of ppf to those of argument out_funs,
This way, you can change the meaning of indentation (which can be something else than just printing space characters) and the meaning of new lines opening (which can be connected to any other action needed by the application at hand).
Context: oCaml
Library: Format

Instruction: get_formatter_out_functions ()
Language: oCaml
Returns: The current output functions of the pretty-printer, including line splitting and indentation functions
Library: Format
Intuition: record the current setting and restore it afterwards.

Instruction: f.mark_open_tag foo
Effect: the string opening the tag foo
Language: oCaml
Variables: f: a formatter_tag_functions
Library: Format

Instruction: f.mark_close_tag foo
Effect: the string closing the tag foo
Language: oCaml
Variables: f: a formatter_tag_functions
Library: Format

Instruction: f.print_close_tag foo
Effect: print the string closing the tag foo in pretty printer queue
Language: oCaml
Variables: f: a formatter_tag_functions
Library: Format

Instruction: f.print_open_tag foo
Effect: print the string opening the tag foo in pretty printer queue
Language: oCaml
Variables: f: a formatter_tag_functions
Library: Format

Instruction: set_formatter_tag_function foo
Effect: changes the meaning of opening and closing semantic tag operations to use the functions in tag_funs when printing on ppf.
Language: oCaml
Library: Format

Instruction: get_formatter_tag_function ()
Language: oCaml
Returns: The current semantic tag operation functions of the standard pretty-printer.
Library: Format

Instruction: formatter_of_out_channel foo
Language: oCaml
Returns: a new formatter writing to the corresponding output channel foo
Library: Format

Instruction: std_formatter
Effect: standard_formatter to write to standard output
Language: oCaml
Library: Format

Instruction: formatter_of_buffer foo
Effect: new formatter writing to buffer foo
Language: oCaml
Library: Format

Instruction: stdbuf
Effect: string buffer in which str_formatter writes.
Language: oCaml
Library: Format

Instruction: str_formatter
Effect: A formatter to output to the Format.stdbuf string buffer.
Language: oCaml
Library: Format

Instruction: flush_str_formatter ()
Language: oCaml
Returns: the material printed with str_formatter, flushes the formatter and resets the corresponding buffer.
Library: Format

Instruction: make_formatter foo bar
Effect: new formatter output with foo and flush with bar
Language: oCaml
Library: Format

Instruction: formatter_of_out_functions foo
Effect: new formatter that writes with the set of output functions foo
Language: oCaml
Library: Format

Instruction: Output_flush
Effect: Symbolic flush command
Language: oCaml
Typ: symbolic_output_item
Library: Format

Instruction: Output_newline
Page: https://caml.inria.fr/pub/docs/manual-ocaml/libref/Format.html
Effect: Symbolic newline command
Language: oCaml
Typ: symbolic_output_item
Library: Format

Instruction: Output_string s
Effect: Symbolic output for string s
Language: oCaml
Typ: symbolic_output_item
Library: Format

Instruction: Output_space s
Effect: Symbolic output of n spaces
Language: oCaml
Typ: symbolic_output_item
Library: Format

Instruction: Output_indent s
Effect: Symbolic output of indentation of size
Language: oCaml
Typ: symbolic_output_item
Library: Format

Instruction: clear_symbolic_output_buffer foo
Effect: reset buffer foo
Language: oCaml
Typ: Format

Instruction: get_symbolic_output_buffer foo
Effect: return the content of the buffer foo
Language: oCaml
Returns: The content of the buffer foo
Typ: Format

Instruction: flush_symbolic_output_buffer foo
Effect: equivalent to let items = get_symbolic_output_buffer foo in
    clear_symbolic_output_buffer foo; items
Language: oCaml
Typ: Format

Instruction: add_symbolic_output_buffer foo bar
Effect: add item bar to buffer foo
Language: oCaml
Typ: Format

Instruction: formatter_of_symbolic_output_buffer foo
Effect: symbolic formatter that outputs to: symbolic_output_buffer foo
Language: oCaml
Typ: Format

Instruction: pp_print_list fmt ?foo zap bar
Effect: prints items of list bar using zap to print each item, calling foo between (if this argument is given)
Language: oCaml
Typ: Format

Instruction: pp_print_text fmt foo
Effect: prints string foo with spaces and newlines respectievely printed using pp_print_space and pp_force_newline
Language: oCaml
Typ: Format

Instruction: fprintf fmt foo bar_1 ... bar_n
Effect: Prints in formater fmt according to format string foo with parameter bar_i
Language: oCaml
Typ: Format

Instruction: @<foo>
Effect: print next item as if its size is foo
Language: oCaml
Context: pretty printing string
Typ: Format

Instruction: @{<foo>
Effect: Open a semantic tag foo
Language: oCaml
Context: pretty printing string
Typ: Format

Instruction: @{
Effect: Open a semantic tag with empty string
Language: oCaml
Context: pretty printing string
Typ: Format

Instruction: @}
Effect: close the most recently opened semantic tag
Language: oCaml
Context: pretty printing string
Typ: Format

Instruction: @?
Effect: equivalent to print_flush ()
Language: oCaml
Context: pretty printing string

Instruction: @\n
Effect: equivalent to force_newline ()
Language: oCaml
Context: pretty printing string

Instruction: %@
Effect: print an @
Language: oCaml
Context: pretty printing string

Instruction: printf
Effect: fprintf std_formatter
Language: oCaml
Context: pretty printing string

Instruction: eprintf
Effect: fprintf err_formatter
Language: oCaml
Context: pretty printing string

Instruction: sprintf foo
Effect: A string containing the result of fprintf foo
Language: oCaml
Context: pretty printing string

Instruction: asprintf foo
Effect: A string containing the result of fprintf foo
Language: oCaml
Context: pretty printing string

Instruction: ifprintf foo
Effect: similar to fprintf but does not print anything
Language: oCaml
Context: pretty printing string

Instruction: kfprintf
Effect: Same as fprintf, but instead of returning immediately, passes the formatter to its first argument at the end of printing.
Language: oCaml
Context: pretty printing string

Instruction: ikfprintf
Effect: Same as ikfprintf above, but does not print anything. Useful to ignore some material when conditionally printing.
Language: oCaml
Context: pretty printing string

Instruction: ksfprintf
Effect: Same as sprintf above, but instead of returning the string, passes it to the first argument.
Language: oCaml
Context: pretty printing string

Instruction: kasfprintf
Effect: Same as asprintf above, but instead of returning the string,
Language: oCaml