diff --git a/src/CHANGELOG b/src/CHANGELOG index 220d9b5ca..076ab1a9f 100755 --- a/src/CHANGELOG +++ b/src/CHANGELOG @@ -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 *** diff --git a/src/c/symbols_list.h b/src/c/symbols_list.h index 3b20d662c..e93452cb4 100755 --- a/src/c/symbols_list.h +++ b/src/c/symbols_list.h @@ -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}}; diff --git a/src/c/symbols_list2.h b/src/c/symbols_list2.h index e6eb396a0..90db2e847 100644 --- a/src/c/symbols_list2.h +++ b/src/c/symbols_list2.h @@ -2043,5 +2043,7 @@ cl_symbols[] = { {SYS_ "FUNCTION-BOUNDARY",NULL}, +{EXT_ "*INSPECTOR-HOOK*",NULL}, + /* Tag for end of list */ {NULL,NULL}}; diff --git a/src/lsp/describe.lsp b/src/lsp/describe.lsp index 43584e8b8..df250b0cb 100644 --- a/src/lsp/describe.lsp +++ b/src/lsp/describe.lsp @@ -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)