diff options
-rw-r--r-- | libguile/struct.c | 11 |
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); |