Skip to main content
Participant
July 8, 2019
Answered

Value of Composite Object

  • July 8, 2019
  • 1 reply
  • 262 views

I've read PostScript language reference, but I'm still unclear, what will be if we Save array of integers than changed values of integers and than Restore the arrray?

Citation from 3.7.1:

"The array is a composite object whose value resides in VM. The value in turn

consists of two objects, an integer and a string."

But integers are simple objects and contain values neither local nor global VM but in themselves. So, I can suppose that Restore doesn't change back values of integers. But what does it mean following statement in this case:

Citation from 3.7.3:

"Resets the values of all composite objects in local VM, except strings, to their

state at the time of the save"

What the value of array of integers must be reset?

This topic has been closed for replies.
Correct answer Test Screen Name

Integers in a composite object are part of VM, because they are simply part of the composite object, which is in VM.

Consider: create an array of 10,000 elements. This will consume VM (in many implementations, not all, it will consume 80,000 bytes of VM). Each element is stored in VM. For simple objects, the value of each simple object is in one of the elements, and is stored in VM. There is simply nowhere else it can be.

1 reply

Test Screen NameCorrect answer
Legend
July 8, 2019

Integers in a composite object are part of VM, because they are simply part of the composite object, which is in VM.

Consider: create an array of 10,000 elements. This will consume VM (in many implementations, not all, it will consume 80,000 bytes of VM). Each element is stored in VM. For simple objects, the value of each simple object is in one of the elements, and is stored in VM. There is simply nowhere else it can be.

skolodAuthor
Participant
July 8, 2019

Thank, you very much for quick answer.