Visualization Tools User's Guide


Searching Objects

The Snooper allows you to search through a hierarchy of objects for values satisfying a predicate (a boolean expression). The search is a depth-limited depth-first search. There are many ways of tuning the search.

  1. Press the Search button, opening a (Spy Search) window.
  2. In the Search For tab of the (Spy Search) window, type a one-argument block which answers true when applied to an object that you are looking for, and false otherwise. If your block fails on a given argument (e.g., if you call x accelerator and some x does not respond to #accelerator), the block is considered to return false.
  3. Select the depth of the search by picking a radio button at the bottom of the window. The depth 2 is selected by default. Depths higher than 6 are available by selecting the + radio button, then using the spinner. The search engine is fairly slow, so large depths are not recommended.
  4. (Optional) Prune the search. Select the Prune tab. Fill in the block of code titled Only search under values which satisfy. This block is a two-argument block, taking (1) the attribute name being searched, and (2) the value of that attribute. When the block returns true, the search engine will look beneath that block. Pruning can speed up the search -- or can slow it down, because testing values to be pruned (even with a very simple test) is expensive.
  5. (Optional) On the Options tab, set the options that you want for the search.
  6. When you are ready to search, press the Search! button.

    The Snooper keeps a list of the searches you have performed. If you want to repeat a search, possibly with modifications:

  7. Press the Prev button (or Next button) until the search that you want to redo or modify appears.
  8. (Optional) Press the Copy button to create a new copy of that search, so that changes you do will not modify the original one.
  9. Update the controls as above, and perform your search.


[ Top of Page | Previous Page | Next Page | Table of Contents ]