# HG changeset patch # User Aidan Kehoe # Date 1293912524 0 # Node ID 47298dcf2e8f5c682b0de506fe079c93d9e639d1 # Parent d0bb90d90736edce79c191c51c5592f8ee49ced7 Be more helpful in printing ephemerons, weak lists, and weak boxes. 2011-01-01 Aidan Kehoe * data.c (print_ephemeron, print_weak_list, print_weak_box): Be more helpful in printing these structures; show their contents, print their UIDs so it's possible to distinguish between them. diff -r d0bb90d90736 -r 47298dcf2e8f src/ChangeLog --- a/src/ChangeLog Thu Dec 30 13:46:50 2010 +0000 +++ b/src/ChangeLog Sat Jan 01 20:08:44 2011 +0000 @@ -1,3 +1,9 @@ +2011-01-01 Aidan Kehoe + + * data.c (print_ephemeron, print_weak_list, print_weak_box): + Be more helpful in printing these structures; show their contents, + print their UIDs so it's possible to distinguish between them. + 2010-12-30 Aidan Kehoe * lisp.h (DECLARE_N_KEYWORDS_8, DECLARE_N_KEYWORDS_9) diff -r d0bb90d90736 -r 47298dcf2e8f src/data.c --- a/src/data.c Thu Dec 30 13:46:50 2010 +0000 +++ b/src/data.c Sat Jan 01 20:08:44 2011 +0000 @@ -2612,14 +2612,19 @@ static void print_weak_list (Lisp_Object obj, Lisp_Object printcharfun, - int UNUSED (escapeflag)) + int escapeflag) { if (print_readably) - printing_unreadable_lisp_object (obj, 0); - - write_fmt_string_lisp (printcharfun, "#", 2, - encode_weak_list_type (XWEAK_LIST (obj)->type), - XWEAK_LIST (obj)->list); + { + printing_unreadable_lisp_object (obj, 0); + } + + write_ascstring (printcharfun, "#type), + printcharfun, escapeflag); + write_ascstring (printcharfun, " :list "); + print_internal (XWEAK_LIST (obj)->list, printcharfun, escapeflag); + write_fmt_string (printcharfun, " 0x%x>", LISP_OBJECT_UID (obj)); } static int @@ -3087,12 +3092,16 @@ } static void -print_weak_box (Lisp_Object obj, Lisp_Object printcharfun, - int UNUSED (escapeflag)) +print_weak_box (Lisp_Object obj, Lisp_Object printcharfun, int escapeflag) { if (print_readably) - printing_unreadable_lisp_object (obj, 0); - write_fmt_string (printcharfun, "#"); /* #### fix */ + { + printing_unreadable_lisp_object (obj, 0); + } + + write_ascstring (printcharfun, "#value, printcharfun, escapeflag); + write_fmt_string (printcharfun, " 0x%x>", LISP_OBJECT_UID (obj)); } static int @@ -3309,12 +3318,20 @@ } static void -print_ephemeron (Lisp_Object obj, Lisp_Object printcharfun, - int UNUSED (escapeflag)) +print_ephemeron (Lisp_Object obj, Lisp_Object printcharfun, int escapeflag) { if (print_readably) - printing_unreadable_lisp_object (obj, 0); - write_fmt_string (printcharfun, "#"); /* #### fix */ + { + printing_unreadable_lisp_object (obj, 0); + } + + write_ascstring (printcharfun, "#key, printcharfun, escapeflag); + write_ascstring (printcharfun, " :value "); + print_internal (XEPHEMERON (obj)->value, printcharfun, escapeflag); + write_ascstring (printcharfun, " :finalizer "); + print_internal (XEPHEMERON_FINALIZER (obj), printcharfun, escapeflag); + write_fmt_string (printcharfun, " 0x%x>", LISP_OBJECT_UID (obj)); } static int