summaryrefslogtreecommitdiff
path: root/libguile/struct.c
diff options
context:
space:
mode:
authorMikael Djurfeldt <djurfeldt@nada.kth.se>1999-07-29 23:02:26 +0000
committerMikael Djurfeldt <djurfeldt@nada.kth.se>1999-07-29 23:02:26 +0000
commita1ae1799ac85cd7918ea4188517d17f841f73e6a (patch)
tree89b247ad4d2baffa6e89d639ec0d234d5839752f /libguile/struct.c
parentfe970d8448e6a2d954c092869e08b604fbe76b79 (diff)
downloadguile-a1ae1799ac85cd7918ea4188517d17f841f73e6a.tar.gz
* struct.c (scm_print_struct): Use vtable name.
Diffstat (limited to 'libguile/struct.c')
-rw-r--r--libguile/struct.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/libguile/struct.c b/libguile/struct.c
index cd9a38a96..6fbf8596a 100644
--- a/libguile/struct.c
+++ b/libguile/struct.c
@@ -702,8 +702,15 @@ scm_print_struct (exp, port, pstate)
scm_printer_apply (SCM_STRUCT_PRINTER (exp), exp, port, pstate);
else
{
- scm_lfwrite ("#<struct ", sizeof ("#<struct ") - 1, port);
- scm_intprint (SCM_STRUCT_VTABLE (exp), 16, port);
+ SCM vtable = SCM_STRUCT_VTABLE (exp);
+ SCM name = scm_struct_vtable_name (vtable);
+ scm_puts ("#<", port);
+ if (SCM_NFALSEP (name))
+ scm_display (name, port);
+ else
+ scm_puts ("struct", port);
+ scm_putc (' ', port);
+ scm_intprint (vtable, 16, port);
scm_putc (':', port);
scm_intprint (exp, 16, port);
scm_putc ('>', port);