Visualization Tools User's Guide


Example of Working with Variables

We will manipulate an array in several ways, showing off the features of the evaluation pane.

  1. In a workspace, type and evaluate (Array new: 13) snoop.
  2. In the resulting snoop window, select the self line.
  3. Press alt+X. (Or, push the X:= button, or from Actions or the popup menu select X := Selected item). This sets the global variable X to the array.
  4. Press alt+V. (Or, from Actions select Toggle Evaluation Pane).
    Nil window
  5. Click on the workspace pane of the Snooper.
  6. Type X at: 3 put: Transcript.
  7. Press control+E. (Or, from the popup menu select Evaluate) to evaluate the expression.
  8. Press the Rebuild button.
    Evaluate and Rebuild window
  9. Clear the workspace pane (control+l, or select Clear from the popup menu.
  10. Type X select: [:v | v notNil], and evaluate it.
  11. Note that a one-element array has appeared in the "value" column, and the expression you evaluated in the "expression" column of the table pane.
  12. Clear the workspace pane. Type X size, and evaluate it.
  13. Note that 13 has appeared as the first value in the table pane.
  14. Scroll the table down. Note that the value and select: expression from step 10 are further down in the table.
  15. Select that line.
  16. From the popup menu select Edit.
  17. Note that X select: [:v | v notNil], the expression from step 10, appears in the workspace pane.
  18. Replace select: by reject:, and evaluate the resulting expression.
  19. Note than an array of nil's has appeared as the first element in the table, and the 13 has dropped to a lower position.


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