ECL implements EXT:*INSPECTOR-HOOK*

This commit is contained in:
Juan Jose Garcia Ripoll 2011-02-12 19:31:13 +01:00
parent 0abfe4a7e9
commit b268cc89bd
4 changed files with 31 additions and 15 deletions

View file

@ -201,6 +201,9 @@ ECL 11.1.2
SI:GC-STATS. This made nested TIME calls not to work, as the statistics of
the inner call would spoil those of the outer one. This has been fixed.
- ECL implements CDR 6 (ext:*inspector-hook*) as described in
http://cdr.eurolisp.org/document/6/index.html
;;; Local Variables: ***
;;; mode:text ***
;;; fill-column:79 ***

View file

@ -2043,5 +2043,7 @@ cl_symbols[] = {
{SYS_ "FUNCTION-BOUNDARY", SI_ORDINARY, NULL, -1, OBJNULL},
{EXT_ "*INSPECTOR-HOOK*", EXT_SPECIAL, NULL, -1, Cnil},
/* Tag for end of list */
{NULL, CL_ORDINARY, NULL, -1, OBJNULL}};

View file

@ -2043,5 +2043,7 @@ cl_symbols[] = {
{SYS_ "FUNCTION-BOUNDARY",NULL},
{EXT_ "*INSPECTOR-HOOK*",NULL},
/* Tag for end of list */
{NULL,NULL}};

View file

@ -446,25 +446,34 @@ q (or Q): quits the inspection.~%~
((sys:instancep object) (inspect-instance object))
(t (format t "~S - ~S" object (type-of object))))))
(defun inspect (object &aux (*inspect-mode* t)
(*inspect-level* 0)
(*inspect-history* nil)
(*old-print-level* *print-level*)
(*old-print-length* *print-length*)
(*print-level* 3)
(*print-length* 3))
(defun default-inspector (object)
"Args: (object)
Shows the information about OBJECT interactively. See the ECL Report for the
inspect commands, or type '?' to the inspector."
(declare (si::c-local))
;;(read-line)
(terpri)
(princ "Inspection mode: Type ? followed by #\\Newline for help.")
(terpri)
(terpri)
(catch 'QUIT-INSPECT (inspect-object object))
(terpri)
(values))
(let ((*inspect-mode* t)
(*inspect-level* 0)
(*inspect-history* nil)
(*old-print-level* *print-level*)
(*old-print-length* *print-length*)
(*print-level* 3)
(*print-length* 3))
(terpri)
(princ "Inspection mode: Type ? followed by #\\Newline for help.")
(terpri)
(terpri)
(catch 'QUIT-INSPECT (inspect-object object))
(terpri)
(values)))
(defun inspect (object)
(print 'hola)
(print ext:*inspector-hook*)
(if ext:*inspector-hook*
(funcall *inspector-hook* object)
(default-inspector object))
object)
(defun describe (object &optional (stream *standard-output*)
&aux (*inspect-mode* nil)