[Next] [Previous] [Up] [Top] [Contents] [Index]

Introspection commands

Examining objects with the Inspector

The Inspector lets you look quickly at any component of an object. It provides a route to the source code of the object. It even lets you edit many of the attributes of an object that is being inspected. The Inspector is readily available from many other windows such as the Apropos window.

Double-clicking on an object displayed in an Inspector window brings up another Inspector window displaying the components of that object.

Because objects are editable in Inspector windows, you can change the state of system internals and other components on the fly. However, you should modify an object with the Inspector only when you understand how it works and what effect your modification will have. Otherwise you may corrupt your environment or even cause your Macintosh to crash.

For example, it is safe to set the value of a global variable in the Inspector window when inspecting a symbol. However, it's inadvisable to use the Inspector to set the values of slots in objects; use the standard interface functions instead.

There are a number of ways to invoke the inspector:

  • You can inspect a symbol by selecting it or placing the cursor inside it and issuing the Fred command Control-x Control-i. When you inspect a symbol, the inspector will also show you all the objects associated with the definitions of the symbol, such as the function if the symbol has a function definition, or the class if the symbol has a class definition.
  • You can use the Common Lisp function inspect. This function takes any object as its argument, and inspects that object.
  • The Inspector command on the Tools menu has a number of sub-commands for inspecting some built-in aspects of MCL.
  • Many of the other debugging tools, such as the apropos window or the stack backtrace (described below) allow you to inspect the objects they display simply by double-clicking them.

  • The following sections show some examples of using the Inspector.

    Inspecting an object with inspect
    Inspecting objects from other tool windows

    Gettmg Started with MCL - 19 OCT 1996
    [Next] [Previous] [Up] [Top] [Contents] [Index]

    Generated with Harlequin WebMaker