[racket] Are there any papers that explain Code/Structure Inspectors?
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
`racket/gui':
> (define i (current-inspector))
> (current-inspector (make-inspector))
> (require racket/gui)
> (class-info button%)
class-info: current inspector cannot inspect class
class: #<class:button%>
context...:
/Users/mflatt/proj/plt/collects/racket/private/misc.rkt:87:7
> (current-inspector i)
> (class-info button%)
'button%
0
'()
'field-ref
'field-set!
#<class:basic-control%>
#f
>
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.