[racket] Are there any papers that explain Code/Structure Inspectors?

From: Matthew Flatt (mflatt at cs.utah.edu)
Date: Mon Jun 25 17:33:37 EDT 2012

At Sun, 24 Jun 2012 15:14:12 -0700, Ian Tegebo wrote:
> I was playing with #lang racket/gui, and then did,
> > (class-info button%)
> class-info: current inspector cannot inspect class: #<class:button%>
> Reading a bit of the reference manual turned up both "code" and
> "structure" inspectors, but I'm not sure how to solve my particular
> problem.  That aside, are there any papers that introduce
> "inspectors"?

No. There are no such papers, yet, although there should be.

To inspect `button%', you'd need to set the inspector before loading

 > (define i (current-inspector))
 > (current-inspector (make-inspector))
 > (require racket/gui)
 > (class-info button%)
 class-info: current inspector cannot inspect class
   class: #<class:button%>
 > (current-inspector i)
 > (class-info button%)

The intent is that `button%' is opaque to clients of `racket/gui'.
Setting the inspector before loading `racket/gui' is stepping outside
the system and taking extra control to, say, debug `racket/gui' itself.

Posted on the users mailing list.