7 #include "cln/floatformat.h"
9 #include "cln/string.h"
13 struct cl_print_rational_flags {
14 // Base in which rational numbers are to be printed.
15 unsigned int rational_base;
16 // Flag whether to print radix specifiers in Common Lisp syntax for
17 // rational numbers (#nR or #b or #o or #x prefixes, trailing dot).
18 bool rational_readably;
20 cl_print_rational_flags () :
22 rational_readably (false) {}
25 struct cl_print_float_flags {
26 // Flag whether to prefer type specific exponent markers over 'E'.
28 // If !float_readably, the format which earns the 'E' exponent marker.
29 float_format_t default_float_format;
31 cl_print_float_flags () :
32 float_readably (false),
33 default_float_format (float_format_ffloat) {}
36 struct cl_print_real_flags : cl_print_rational_flags, cl_print_float_flags {};
38 struct cl_print_complex_flags {
39 // Flag whether to use the Common Lisp #C(realpart imagpart) syntax,
40 bool complex_readably;
42 cl_print_complex_flags () :
43 complex_readably (false) {}
46 struct cl_print_number_flags : cl_print_real_flags, cl_print_complex_flags {};
48 enum cl_print_vector_syntax_t {
49 vsyntax_algebraic, // [a, b, c]
50 vsyntax_pretty, // [a b c]
51 vsyntax_commonlisp // #(a b c)
54 struct cl_print_vector_flags {
55 cl_print_vector_syntax_t vector_syntax;
57 cl_print_vector_flags () :
58 vector_syntax (vsyntax_pretty) {}
61 struct cl_print_univpoly_flags {
62 cl_string univpoly_varname;
64 cl_print_univpoly_flags () :
65 univpoly_varname ("x") {}
68 struct cl_print_flags : cl_print_number_flags, cl_print_vector_flags, cl_print_univpoly_flags {};
70 extern cl_print_flags default_print_flags;
74 #endif /* _CL_OUTPUT_H */