Function: eieio-override-prin1

eieio-override-prin1 is a byte-compiled function defined in eieio.el.gz.

Signature

(eieio-override-prin1 THING)

Documentation

Perform a prin1 on THING taking advantage of object knowledge.

Source Code

;; Defined in /usr/src/emacs/lisp/emacs-lisp/eieio.el.gz
(defun eieio-override-prin1 (thing)
  "Perform a `prin1' on THING taking advantage of object knowledge."
  (cond ((eieio-object-p thing)
	 (object-write thing))
	((consp thing)
	 (eieio-list-prin1 thing))
	((hash-table-p thing)
         (let ((copy (copy-hash-table thing)))
	   (maphash
	    (lambda (key val)
	      (setf (gethash key copy)
		    (read
		     (with-output-to-string
		       (eieio-override-prin1 val)))))
	    copy)
	   (prin1 copy)))
	((vectorp thing)
         (let ((copy (copy-sequence thing)))
	  (dotimes (i (length copy))
	    (aset copy i
		  (read
		   (with-output-to-string
		     (eieio-override-prin1
		      (aref copy i))))))
	  (prin1 copy)))
	((eieio--class-p thing)
	 (princ (eieio--class-print-name thing)))
	(t (prin1 thing))))