/[slime]/slime/swank-backend.lisp
ViewVC logotype

Diff of /slime/swank-backend.lisp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.204 by alendvai, Fri Oct 15 22:42:14 2010 UTC revision 1.205 by heller, Sun Nov 7 19:48:21 2010 UTC
# Line 1053  output of CL:DESCRIBE." Line 1053  output of CL:DESCRIBE."
1053    
1054  ;;; Utilities for inspector methods.  ;;; Utilities for inspector methods.
1055  ;;;  ;;;
1056  (defun label-value-line (label value &key padding-length display-nil-value hide-when-nil  
1057                                 splice-as-ispec value-text (newline t))  (defun label-value-line (label value &key (newline t))
1058    "Create a control list which prints \"LABEL: VALUE\" in the inspector."    "Create a control list which prints \"LABEL: VALUE\" in the inspector.
1059    (if (or value (not hide-when-nil))  If NEWLINE is non-NIL a `(:newline)' is added to the result."
1060        `((:label ,(princ-to-string label) ":")    (list* (princ-to-string label) ": " `(:value ,value)
1061          ,@(when (or value display-nil-value)           (if newline '((:newline)) nil)))
                 (list " "))  
         ,@(when (and (or value display-nil-value)  
                      padding-length)  
                 (list (make-array padding-length  
                                   :element-type 'character  
                                   :initial-element #\Space)))  
         ,@(when (or value display-nil-value)  
                 (if splice-as-ispec  
                     (if (listp value) value (list value))  
                     `((:value ,value ,@(when value-text (list value-text))))))  
         ,@(if newline '((:newline)) nil))  
       (values)))  
1062    
1063  (defmacro label-value-line* (&rest label-values)  (defmacro label-value-line* (&rest label-values)
1064    (let ((longest-label-length (loop    ` (append ,@(loop for (label value) in label-values
1065                                   :for (label value) :in label-values                      collect `(label-value-line ,label ,value))))
                                  :maximize (if (stringp label)  
                                                (length label)  
                                                0))))  
   `(append ,@(loop  
                 :for entry :in label-values  
                 :if (and (consp entry)  
                          (not (consp (first entry)))  
                          (string= (first entry) '@))  
                   :appending (rest entry)  
                 :else  
                   :collect (destructuring-bind  
                                  (label value &rest args &key &allow-other-keys) entry  
                              `(label-value-line ,label ,value  
                                                 :padding-length ,(when (stringp label)  
                                                                        (- longest-label-length  
                                                                           (length label)))  
                                                 ,@args))))))  
1066    
1067  (definterface describe-primitive-type (object)  (definterface describe-primitive-type (object)
1068    "Return a string describing the primitive type of object."    "Return a string describing the primitive type of object."

Legend:
Removed from v.1.204  
changed lines
  Added in v.1.205

  ViewVC Help
Powered by ViewVC 1.1.5