comparison src/data.c @ 5325:47298dcf2e8f

Be more helpful in printing ephemerons, weak lists, and weak boxes. 2011-01-01 Aidan Kehoe <kehoea@parhasard.net> * 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.
author Aidan Kehoe <kehoea@parhasard.net>
date Sat, 01 Jan 2011 20:08:44 +0000
parents c096d8051f89
children d967d96ca043 89331fa1c819
comparison
equal deleted inserted replaced
5324:d0bb90d90736 5325:47298dcf2e8f
2610 return Qnil; /* nichts ist gemarkt */ 2610 return Qnil; /* nichts ist gemarkt */
2611 } 2611 }
2612 2612
2613 static void 2613 static void
2614 print_weak_list (Lisp_Object obj, Lisp_Object printcharfun, 2614 print_weak_list (Lisp_Object obj, Lisp_Object printcharfun,
2615 int UNUSED (escapeflag)) 2615 int escapeflag)
2616 { 2616 {
2617 if (print_readably) 2617 if (print_readably)
2618 printing_unreadable_lisp_object (obj, 0); 2618 {
2619 2619 printing_unreadable_lisp_object (obj, 0);
2620 write_fmt_string_lisp (printcharfun, "#<weak-list %s %S>", 2, 2620 }
2621 encode_weak_list_type (XWEAK_LIST (obj)->type), 2621
2622 XWEAK_LIST (obj)->list); 2622 write_ascstring (printcharfun, "#<weak-list :type ");
2623 print_internal (encode_weak_list_type (XWEAK_LIST (obj)->type),
2624 printcharfun, escapeflag);
2625 write_ascstring (printcharfun, " :list ");
2626 print_internal (XWEAK_LIST (obj)->list, printcharfun, escapeflag);
2627 write_fmt_string (printcharfun, " 0x%x>", LISP_OBJECT_UID (obj));
2623 } 2628 }
2624 2629
2625 static int 2630 static int
2626 weak_list_equal (Lisp_Object obj1, Lisp_Object obj2, int depth, int foldcase) 2631 weak_list_equal (Lisp_Object obj1, Lisp_Object obj2, int depth, int foldcase)
2627 { 2632 {
3085 { 3090 {
3086 return Qnil; 3091 return Qnil;
3087 } 3092 }
3088 3093
3089 static void 3094 static void
3090 print_weak_box (Lisp_Object obj, Lisp_Object printcharfun, 3095 print_weak_box (Lisp_Object obj, Lisp_Object printcharfun, int escapeflag)
3091 int UNUSED (escapeflag))
3092 { 3096 {
3093 if (print_readably) 3097 if (print_readably)
3094 printing_unreadable_lisp_object (obj, 0); 3098 {
3095 write_fmt_string (printcharfun, "#<weak-box>"); /* #### fix */ 3099 printing_unreadable_lisp_object (obj, 0);
3100 }
3101
3102 write_ascstring (printcharfun, "#<weak-box ");
3103 print_internal (XWEAK_BOX (obj)->value, printcharfun, escapeflag);
3104 write_fmt_string (printcharfun, " 0x%x>", LISP_OBJECT_UID (obj));
3096 } 3105 }
3097 3106
3098 static int 3107 static int
3099 weak_box_equal (Lisp_Object obj1, Lisp_Object obj2, int depth, int foldcase) 3108 weak_box_equal (Lisp_Object obj1, Lisp_Object obj2, int depth, int foldcase)
3100 { 3109 {
3307 { 3316 {
3308 return Qnil; 3317 return Qnil;
3309 } 3318 }
3310 3319
3311 static void 3320 static void
3312 print_ephemeron (Lisp_Object obj, Lisp_Object printcharfun, 3321 print_ephemeron (Lisp_Object obj, Lisp_Object printcharfun, int escapeflag)
3313 int UNUSED (escapeflag))
3314 { 3322 {
3315 if (print_readably) 3323 if (print_readably)
3316 printing_unreadable_lisp_object (obj, 0); 3324 {
3317 write_fmt_string (printcharfun, "#<ephemeron>"); /* #### fix */ 3325 printing_unreadable_lisp_object (obj, 0);
3326 }
3327
3328 write_ascstring (printcharfun, "#<ephemeron :key ");
3329 print_internal (XEPHEMERON (obj)->key, printcharfun, escapeflag);
3330 write_ascstring (printcharfun, " :value ");
3331 print_internal (XEPHEMERON (obj)->value, printcharfun, escapeflag);
3332 write_ascstring (printcharfun, " :finalizer ");
3333 print_internal (XEPHEMERON_FINALIZER (obj), printcharfun, escapeflag);
3334 write_fmt_string (printcharfun, " 0x%x>", LISP_OBJECT_UID (obj));
3318 } 3335 }
3319 3336
3320 static int 3337 static int
3321 ephemeron_equal (Lisp_Object obj1, Lisp_Object obj2, int depth, int foldcase) 3338 ephemeron_equal (Lisp_Object obj1, Lisp_Object obj2, int depth, int foldcase)
3322 { 3339 {