Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Reid G.C.Thinking in PostScript.1990.pdf
Скачиваний:
17
Добавлен:
23.08.2013
Размер:
846.44 Кб
Скачать

The illustration in Figure 5.6 gives you an idea of what happens when you duplicate a composite object like a string. All stack manipulations to composite objects operate on the single object, not on the entire body of the composite data. In this example there are two string pointers on the operand stack that have the same value. If one of these is changed, they are both changed, as can be seen in Figure 5.6.

Figure 5.7: Changing a Composite Object

(PostScript) dup

dup 0 (Pre-) putinterval

somewhere in memory

string object

Pre-Script

length: 10

string object

length: 10

THE OTHER STACKS

There are three other stacks used by the interpreter during the execution of your program in addition to the operand stack, which you have been studying: the dictionary stack, which helps with name lookup and in making definitions; the execution stack, which holds partially executed procedure bodies, file objects, and other executable objects; and the graphics state stack, which keeps track of your gsave and grestore operations.

These stacks will be described briefly so that you’ll know about them. For more detailed information, refer to the books PostScript Language Reference Manual and PostScript Language Program Design, both by Adobe Systems, available from Addison-Wesley Publishing Company.

62

Chapter 5: UNDERSTANDING THE STACK