| 1 |
@node Printer |
| 2 |
@section Printer |
| 3 |
|
| 4 |
In all situations where the rules are well specified, ECL prints objects according to ANSI @bibcite{ANSI}. The specification leaves however a number of cases as implementation dependent behavior. The output of ECL in those cases is summarized in @ref{tab:impl-spec-print-rep}. Except for the types @code{character} and @code{random-state}, most of those examples regard non-standard written forms @code{#<...>} cannot be read back using @code{read}. These printed representations are just informative and should not be used to reconstruct or compare objects. |
| 5 |
|
| 6 |
@float Table, tab:impl-spec-print-rep |
| 7 |
@caption{Implementation-specific printed representation} |
| 8 |
@multitable @columnfractions .28 .35 .37 |
| 9 |
@headitem Lisp type @tab Format @tab Remarks |
| 10 |
@item @code{package} @tab @code{#<package @var{name}>} @tab |
| 11 |
@item @code{random-state} @tab @code{#<random-state @var{array}>} @tab |
| 12 |
@item @code{bitvector} @tab @code{#<bit-vector @var{@var{unique-id}}>} @tab Only when @code{*print-array*} is false. |
| 13 |
@item @code{vector} @tab @code{#<vector @var{unique-id}>} @tab Only when @code{*print-array*} is false. |
| 14 |
@item @code{array} @tab @code{#<array @var{unique-id}>} @tab Only when @code{*print-array*} is false. |
| 15 |
@item @code{hash-table} @tab @code{#<hash-table @var{unique-id}>} @tab |
| 16 |
@item @code{readtable} @tab @code{#<readtable @var{unique-id}>} @tab |
| 17 |
@item @code{interpreted function} @tab @code{#<bytecompiled-function @var{name-or-id}>} @tab Name is a symbol. |
| 18 |
@item @code{machine compiled function} @tab @code{#<compiled-function @var{name}>} @tab Name is a symbol. |
| 19 |
@item @code{input-stream} @tab @code{#<input stream "@var{filename}">} @tab An stream that reads from @var{filename}. |
| 20 |
@item @code{output-stream} @tab @code{#<output stream "@var{filename}">} @tab An stream that writes to @var{filename}. |
| 21 |
@item @code{probe-stream} @tab @code{#<probe stream "@var{filename}">} @tab |
| 22 |
@item @code{string-input-stream} @tab @code{#<string-input stream from "@var{string-piece}">} @tab The string is the text left to be read. |
| 23 |
@item @code{string-output-stream} @tab @code{#<string-output stream @var{unique-id}>} @tab |
| 24 |
@item @code{two-way-stream} @tab @code{#<two-way stream @var{unique-id}>} @tab |
| 25 |
@item @code{echo-stream} @tab @code{#<echo stream @var{unique-id}>} @tab |
| 26 |
@item @code{synonym-stream} @tab @code{#<synonym stream to @var{symbol}>} @tab |
| 27 |
@item @code{broadcast-stream} @tab @code{#<broadcast stream @var{unique-id}>} @tab |
| 28 |
@item @code{concatenated-stream} @tab @code{#<concatenated stream @var{unique-id}>} @tab |
| 29 |
@item @code{closed-stream} @tab @code{#<closed ...>} @tab The dots denote any of the above stream forms. |
| 30 |
@end multitable |
| 31 |
@end float |
| 32 |
|
| 33 |
@subsection C Reference |
| 34 |
|
| 35 |
@subsubsection ANSI Dictionary |
| 36 |
Common Lisp and C equivalence |
| 37 |
|
| 38 |
@multitable @columnfractions .3 .7 |
| 39 |
@headitem Lisp symbol @tab C function |
| 40 |
@item @clhs{f_cp_ppr.htm,copy-pprint-dispatch} @tab cl_object cl_copy_pprint_dispatch(cl_narg narg, ...) |
| 41 |
@item @clhs{f_ppr_di.htm,pprint-dispatch} @tab cl_object cl_pprint_dispatch(cl_narg narg, cl_object object, ...) |
| 42 |
@item @clhs{f_ppr_fi.htm,pprint-fill} @tab cl_object cl_pprint_fill(cl_narg narg, cl_object stream, cl_object object, ...) |
| 43 |
@item @clhs{f_ppr_fi.htm,pprint-linear} @tab cl_object cl_pprint_linear(cl_narg narg, cl_object stream, cl_object object, ...) |
| 44 |
@item @clhs{f_ppr_fi.htm,pprint-tabular} @tab cl_object cl_pprint_tabular(cl_narg narg, cl_object stream, cl_object object, ...) |
| 45 |
@item @clhs{f_ppr_in.htm,pprint-indent} @tab cl_object cl_pprint_indent(cl_narg narg, cl_object relative_to, cl_object n, ...) |
| 46 |
@item @clhs{f_ppr_nl.htm,pprint-newline} @tab cl_object cl_pprint_newline(cl_narg narg, cl_object kind, ...) |
| 47 |
@item @clhs{f_ppr_ta.htm,pprint-tab} @tab cl_object cl_pprint_tab(cl_narg narg, cl_object kind, cl_object colnum, cl_object colinc, ...) |
| 48 |
@item @clhs{f_pr_obj.htm,print-object} @tab [Only in Common Lisp] |
| 49 |
@item @clhs{f_set_pp.htm,set-pprint-dispatch} @tab cl_object cl_set_pprint_dispatch(cl_narg narg, cl_object ype_spec, cl_object function, ...) |
| 50 |
@item @clhs{f_wr_pr.htm,write} @tab cl_object cl_write(cl_narg narg, cl_object object, ...) |
| 51 |
@item @clhs{f_wr_pr.htm,prin1} @tab cl_object cl_prin1(cl_narg narg, cl_object object, ...) |
| 52 |
@item @clhs{f_wr_pr.htm,princ} @tab cl_object cl_princ(cl_narg narg, cl_object object, ...) |
| 53 |
@item @clhs{f_wr_pr.htm,print} @tab cl_object cl_print(cl_narg narg, cl_object object, ...) |
| 54 |
@item @clhs{f_wr_pr.htm,pprint} @tab cl_object cl_pprint(cl_narg narg, cl_object object, ...) |
| 55 |
@item @clhs{f_wr_to_.htm,write-to-string} @tab cl_object cl_write_to_string(cl_narg narg, cl_object object, ...) |
| 56 |
@item @clhs{f_wr_to_.htm,prin1-to-string} @tab cl_object cl_prin1_to_string(cl_object object) |
| 57 |
@item @clhs{f_wr_to_.htm,princ-to-string} @tab cl_object cl_princ_to_string(cl_object object) |
| 58 |
@item @clhs{f_pr_not.htm,print-not-readable-object} @tab [Only in Common Lisp] |
| 59 |
@item @clhs{f_format.htm,format} @tab cl_object cl_format(cl_narg narg, cl_object stream, cl_object string, ...) |
| 60 |
@end multitable |