Function: readablep
readablep is a byte-compiled function defined in subr.el.gz.
Signature
(readablep OBJECT)
Documentation
Say whether OBJECT has a readable syntax.
This means that OBJECT can be printed out and then read back
again by the Lisp reader. This function returns nil if OBJECT is
unreadable, and the printed representation (from prin1) of
OBJECT if it is readable.
Probably introduced at or before Emacs version 29.1.
Source Code
;; Defined in /usr/src/emacs/lisp/subr.el.gz
(defun readablep (object)
"Say whether OBJECT has a readable syntax.
This means that OBJECT can be printed out and then read back
again by the Lisp reader. This function returns nil if OBJECT is
unreadable, and the printed representation (from `prin1') of
OBJECT if it is readable."
(declare (side-effect-free error-free))
(catch 'unreadable
(let ((print-unreadable-function
(lambda (_object _escape)
(throw 'unreadable nil))))
(prin1-to-string object))))