CL-USER> (ql:quickload :alexandria) To load "alexandria": Load 1 ASDF system: alexandria ; Loading "alexandria" (:ALEXANDRIA) CL-USER> (defstruct record-list table) RECORD-LIST CL-USER> (defmethod print-object ((object record-list) stream) (flet ((print-guts (stream prettyp &aux (i 0)) (maphash (lambda (key value) (unless (or (null *print-length*) (< i *print-length*)) (write-string (if (zerop i) "..." " ...") stream) (return-from print-guts nil)) (cond ((and prettyp (zerop i)) (pprint-indent :current 0 stream)) (prettyp (write-char #\space stream) (pprint-newline :fill stream)) ((plusp i) (write-char #\space stream))) (incf i) (write key :stream stream) (write-char #\space stream) (write value :stream stream)) (record-list-table object)))) (if (and *print-pretty* (not *print-readably*)) (pprint-logical-block (stream nil :prefix "#<" :suffix ">") (write (type-of object) :stream stream :circle nil :level nil :length nil) ; Insert a space to emulate the spec (write-char #\space stream) (print-guts stream t)) (print-unreadable-object (object stream :type t :identity nil) ; Spec-compliant implementations always insert a space (print-guts stream nil))))) # CL-USER> (let* ((*print-pretty* nil) (*print-length* 2)) (print (make-record-list :table (alexandria:plist-hash-table '(:a 1 :d 1 :c 3 :b 2)))) (values)) # ; No value CL-USER> (let* ((*print-pretty* t) (*print-right-margin* 25)) (print (make-record-list :table (alexandria:plist-hash-table '(:a 1 :d 1 :c 3 :b 2)))) (values)) # ; No value CL-USER> (let* ((*print-pretty* t) (*print-right-margin* 50)) (print (make-record-list :table (alexandria:plist-hash-table '(:a 1 :d 1 :c 3 :b 2)))) (values)) # ; No value CL-USER>