wbooze

minimal case for box highlighting obtrusion in clim

Sep 18th, 2020
329
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lisp 5.81 KB | None | 0 0
  1. (defclass a ()
  2.   (slot1
  3.    slot2))
  4.  
  5. (defclass b ()
  6.   (slot1
  7.    slot2))
  8.  
  9. (defclass c (a b)
  10.   (slot1))
  11.  
  12. (defclass d (c)
  13.   (slot2))
  14.  
  15. (defun my-info ()
  16.   (let* ((*print-pretty* nil)
  17.      (mystream (or (frame-standard-output *application-frame*) *standard-output*))
  18.      (instance-a (make-instance 'a))
  19.      (instance-b (make-instance 'b))
  20.      (instance-c (make-instance 'c))
  21.      (instance-d (make-instance 'd))
  22.      (class-of-a (slot-value (class-of instance-a) 'sb-pcl::name))
  23.      (class-of-b (slot-value (class-of instance-b) 'sb-pcl::name))
  24.      (class-of-c (slot-value (class-of instance-c) 'sb-pcl::name))
  25.      (class-of-d (slot-value (class-of instance-d) 'sb-pcl::name))
  26.      (slots-in-a (with-slots (sb-pcl::slots) (class-of instance-a) sb-pcl::slots))
  27.      (slots-in-b (with-slots (sb-pcl::slots) (class-of instance-b) sb-pcl::slots))
  28.      (slots-in-c (with-slots (sb-pcl::slots) (class-of instance-c) sb-pcl::slots))
  29.      (slots-in-d (with-slots (sb-pcl::slots) (class-of instance-d) sb-pcl::slots))
  30.      (first-from-a (slot-value (first slots-in-a) 'sb-pcl::allocation-class))
  31.      (first-from-b (slot-value (first slots-in-b) 'sb-pcl::allocation-class))
  32.      (first-from-c (slot-value (first slots-in-c) 'sb-pcl::allocation-class))
  33.      (first-from-d (slot-value (first slots-in-d) 'sb-pcl::allocation-class))
  34.      (second-from-a (slot-value (slot-value (second slots-in-a) 'sb-pcl::allocation-class) 'sb-pcl::name))
  35.      (second-from-b (slot-value (slot-value (second slots-in-b) 'sb-pcl::allocation-class) 'sb-pcl::name))
  36.      (second-from-c (slot-value (slot-value (second slots-in-c) 'sb-pcl::allocation-class) 'sb-pcl::name))
  37.      (second-from-d (slot-value (slot-value (second slots-in-d) 'sb-pcl::allocation-class) 'sb-pcl::name))
  38.      (cpl-a (mapcar (lambda (obj) (slot-value obj 'sb-pcl::name))
  39.             (sb-pcl::class-precedence-list (class-of instance-a))))
  40.      (cpl-b (mapcar (lambda (obj) (slot-value obj 'sb-pcl::name))
  41.             (sb-pcl::class-precedence-list (class-of instance-b))))
  42.      (cpl-c (mapcar (lambda (obj) (slot-value obj 'sb-pcl::name))
  43.             (sb-pcl::class-precedence-list (class-of instance-c))))
  44.      (cpl-d (mapcar (lambda (obj) (slot-value obj 'sb-pcl::name))
  45.             (sb-pcl::class-precedence-list (class-of instance-d)))))
  46.    
  47.     (with-output-as-presentation
  48.      (mystream instance-a (presentation-type-of instance-a))
  49.      (format mystream "~%Instance: ~a" instance-a))
  50.     (with-output-as-presentation
  51.      (mystream (first slots-in-a) (presentation-type-of (first slots-in-a)) :single-box :position)
  52.      (format mystream "~%Slot Allocation for Slot ~a" (first slots-in-a))
  53.      (with-output-as-presentation
  54.       (mystream first-from-a (presentation-type-of first-from-a) :single-box :highlighting)
  55.       (format mystream "~%is from: ~a" first-from-a)))
  56.     (with-output-as-presentation
  57.      (mystream '(slots-in-a second-from-a) (presentation-type-of '(slots-in-a second-from-a)))
  58.      (format mystream "~%Slot Allocation for Slot ~a is from: ~a"
  59.          (second slots-in-a) second-from-a))
  60.     (with-output-as-presentation
  61.      (mystream '(instance-a class-of-a cpl-a) (presentation-type-of '(instance-a class-of-a cpl-a)))
  62.      (format mystream "~%class-precedence-list for Instance ~a of Class ~a:~% ~a~%"
  63.          instance-a class-of-a cpl-a))
  64.     (with-output-as-presentation
  65.      (mystream instance-b (presentation-type-of instance-b))
  66.      (format mystream "~%Instance: ~a" instance-b))
  67.     (with-output-as-presentation
  68.      (mystream '(slots-in-b first-from-b) (presentation-type-of '(slots-in-b first-from-b)))
  69.      (format mystream "~%Slot Allocation for Slot ~a is from: ~a"
  70.          (first slots-in-b) first-from-b))
  71.     (with-output-as-presentation
  72.      (mystream '(slots-in-b second-from-b) (presentation-type-of '(slots-in-b second-from-b)))
  73.      (format mystream "~%Slot Allocation for Slot ~a is from: ~a"
  74.          (second slots-in-b) second-from-b))
  75.     (with-output-as-presentation
  76.      (mystream '(instance-b class-of-b cpl-b) (presentation-type-of '(instance-b class-of-b cpl-b)))
  77.      (format mystream "~%class-precedence-list for Instance ~a of Class ~a:~% ~a~%"
  78.          instance-b class-of-b cpl-b))
  79.     (with-output-as-presentation
  80.      (mystream instance-c (presentation-type-of instance-c))
  81.      (format mystream "~%Instance: ~a" instance-c))
  82.     (with-output-as-presentation
  83.      (mystream '(slots-in-c first-from-c) (presentation-type-of '(slots-in-c first-from-c)))
  84.      (format mystream "~%Slot Allocation for Slot ~a is from: ~a"
  85.          (first slots-in-c) first-from-c))
  86.     (with-output-as-presentation
  87.      (mystream '(slots-in-c second-from-c) (presentation-type-of '(slots-in-c second-from-c)))
  88.      (format mystream "~%Slot Allocation for Slot ~a is from: ~a"
  89.          (second slots-in-c) second-from-c))
  90.     (with-output-as-presentation
  91.      (mystream '(instance-c class-of-c cpl-c) (presentation-type-of '(instance-c class-of-c cpl-c)))
  92.      (format mystream "~%class-precedence-list for Instance ~a of Class ~a:~% ~a~%"
  93.          instance-c class-of-c cpl-c))
  94.     (with-output-as-presentation
  95.      (mystream instance-d (presentation-type-of instance-d))
  96.      (format mystream "~%Instance: ~a" instance-d))
  97.     (with-output-as-presentation
  98.      (mystream '(slots-in-d first-from-d) (presentation-type-of '(slots-in-d first-from-d)))
  99.      (format mystream "~%Slot Allocation for Slot ~a is from: ~a"
  100.          (first slots-in-d) first-from-d))
  101.     (with-output-as-presentation
  102.      (mystream '(slots-in-d second-from-d) (presentation-type-of '(slots-in-d second-from-d)))
  103.      (format mystream "~%Slot Allocation for Slot ~a is from: ~a"
  104.          (second slots-in-d) second-from-d))
  105.     (with-output-as-presentation
  106.      (mystream '(instance-d class-of-d cpl-d) (presentation-type-of '(instance-d class-of-d cpl-d)))
  107.      (format mystream "~%class-precedence-list for Instance ~a of Class ~a:~% ~a~%"
  108.          instance-d class-of-d cpl-d))
  109.     (values)))
  110.  
Advertisement
Add Comment
Please, Sign In to add comment