Evaluate an expression
Last updated at 3:16 pm UTC on 14 January 2006
To evaluate, or execute, an expression, you highlight the expression, and then select one of three commands:
- Do-it (alt-d on Windows or cmd-d on Mac) - This evaluates or executes the code but does not display the results, if any. The only way you know something happened is from the side effects.
- Print-it (alt-p on Windows or cmd-p on Mac) - This evaluates or executes the code and display the results immediately afterwards. This is typically used within a Workspace and when the results are easily read.
- Inspect-it (alt-p on Windows or cmd-p on Mac) - This evaluates or executes the code and displays the results in an Inspector window. This is useful when the the results are complex and have muliple parts.
- When directed to do-it, you can always print-it or inspect-it it instead, since the later two actions include a do it.
- If you have trouble remembering the keyboard commands, remmember that you can bring up the context menu (right click or yellow button) and select the desired action from the menu (left click or red button.)
- Although often done within a Workspace, you can do-it, print-it inspect it within a Browser, Inspector, etc.
- You can print-it or inspect-it on any object, but you can only do-it to an expression.