Next Prev Up Top Contents Index

13.3.1.1 Example

Consider the following example, where a closure is defined:

(let ((test-button (make-instance 'capi:button)))
  (defun is-button-enabled ()
    (slot-value test-button 'capi::enabled)))

This has defined the function is-button-enabled , which is a closure over the variable test-button , where the value of test-button is an instance of the capi:button class.

  1. Type the definition of the closure shown above into a listener.
  2. Choose Works > Values > Inspect .
  3. The inspector examines the symbol is-button-enabled .

  4. Click on the FUNCTION item to select the closure.
  5. Choose Works > Slots > Inspect to inspect the selected item.

The closure is inspected.

You can also double-click on an item in the Main area to inspect it.


Common LispWorks User Guide (Windows version) - 14 Dec 2001

Next Prev Up Top Contents Index