summaryrefslogtreecommitdiffstats
path: root/txr.1
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2016-06-01 06:55:21 -0700
committerKaz Kylheku <kaz@kylheku.com>2016-06-01 06:55:21 -0700
commit8a443d67ef95021529db7eb451479e79fb39b272 (patch)
tree98703e3c35ef8d20e4420a8855fee670e1ac427c /txr.1
parentd6ce2f2ab5dbf62e423f632aa9d727f55ac5911b (diff)
downloadtxr-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.18
1 files changed, 8 insertions, 0 deletions
diff --git a/txr.1 b/txr.1
index 8d5906da..e79ec1d7 100644
--- a/txr.1
+++ b/txr.1
@@ -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