3. Interacting with the Interpreter.
In PostScript, as in Lisp, instructions and data are made out of the same
stuff. One of the many interesting implications is that tools for manipulating
data structures can be used on programs as well.
3.1. Using the Keyboard
You can type PostScript expressions into a scrolling text window, and
interact with the traditional PostScript "executive," as you can with "psh"
to NeWS or "tip" to a laser printer. Certain function keys and control
characters do things immediately when you type them, such as input
editing, selecting the input, pushing or executing the selection, and
completing names over the dictionary stack (like "tcsh" file name
completion).
3.2. Using the Mouse
The mouse can be used to select data, push it on the stack, execute it,
and manipulate it in many ways.
Pointing the cursor at an object and clicking the "Menu" button pops up a
menu of operations that can be performed on it. All data types have the same
top level pop-up menu (for uniformity), with a type specific submenu (for
diversity). There are lots of commands for manipulating the object and the
view available via pop-up menus.
You can select any object by clicking the "Point" button on it. A
printed representation of the current selection is always displayed in a field
at the top of the scrolling text window. If you click the Point button over an
object whose label is too small to read, it will appear in the selection
field, in a comfortable font.
Each object has its own button handler function that is called when you
click the "Adjust" button on it. The default "Adjust" handler implements
"drag'n'dropping". If you drop an object onto itself, its view toggles open
or closed. If you drop it on top of a compound object element, it is stored
into that memory location. If you drop it over an unoccupied spot, a new
window viewing the object appears on the deck.
Another useful "Adjust" handler simply executes the object that was
clicked on. This can be used to make buttons out of executable names, arrays,
and strings.
3.3. Using Dictionaries as Command Pallets
A PostScript dictionary can be used as a pallet of commands, by defining
a bunch of useful functions in a dictionary, opening it up, and executing the
functions with the mouse. You can open up the functions to see their
instructions, and even edit them!
3.4. Using a Text Editor
It is very helpful to be running a text editor on the source code of a
PostScript program, while you are debugging it. You can select chunks of
source from the text editor, and execute them in the PSIBER Space Deck (in the
appropriate context). This is especially useful for redefining functions of a
running program in memory, as bugs are discovered and fixed in the source
code. It saves you from having to kill and restart your application every time
you find a trivial bug.
Next section, 4. Debugging Programs.
Previous section, 2. Interacting with Data.
Back to contents.