diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2016-06-01 06:55:21 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2016-06-01 06:55:21 -0700 |
commit | 8a443d67ef95021529db7eb451479e79fb39b272 (patch) | |
tree | 98703e3c35ef8d20e4420a8855fee670e1ac427c /txr.1 | |
parent | d6ce2f2ab5dbf62e423f632aa9d727f55ac5911b (diff) | |
download | txr-8a443d67ef95021529db7eb451479e79fb39b272.tar.gz txr-8a443d67ef95021529db7eb451479e79fb39b272.tar.bz2 txr-8a443d67ef95021529db7eb451479e79fb39b272.zip |
Print method on objects.
* struct.c (print_s): New symbol variable.
(struct_init): Initialize print_s.
(struct_inst_print): If pretty-printing, try to look
up object's print method and use it.
* txr.1: Documented pretty-printing via print method.
Diffstat (limited to 'txr.1')
-rw-r--r-- | txr.1 | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -19280,6 +19280,14 @@ type whose instances have already been inserted as keys in an .code :equal-based hash table, searches for those keys will not work reliably. +.NP* Custom Pretty-Printing + +If a method named by the symbol +.code print +is defined for a structure type, then it is used for pretty-printing instances +of that type. The method takes one argument (in addition to the object), which +specifies the output stream. + .coNP Macro @ defstruct .synb .mets (defstruct >> { name | >> ( name << arg *)} < super |