home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.postscript
- Path: sparky!uunet!destroyer!gatech!purdue!mentor.cc.purdue.edu!news
- From: ab@nova.cc.purdue.edu (Allen B)
- Subject: Re: question about restore
- Message-ID: <C1Kv4y.E7p@mentor.cc.purdue.edu>
- Sender: news@mentor.cc.purdue.edu (USENET News)
- Organization: Purdue University
- References: <1993Jan27.214901.19529@software.org>
- Date: Thu, 28 Jan 1993 18:53:21 GMT
- Lines: 36
-
- In article <1993Jan27.214901.19529@software.org> marshall@software.org (Eric
- Marshall) writes:
- > I do not understand why three is not defined after the restore.
- > The red book says that restore does not affect the contents of the
- > dictionary stack, but there is obviously something more to it than
- > that. Could someone please explain this to me?
-
- It doesn't affect the dictionary stack, it affects the
- value of the dictionary (which is in virtual memory
- (VM)). The save and restore operators have to do with VM.
-
- The dictionary stack gets changed when you do things like
- begin and end. You seem to have some confusion regarding
- the terminology and probably about the workings of
- dictionaries in general.
-
- Briefly (I'm sure you can read a Red Book to fill in the
- gaps), a dictionary is an associative array that
- associates keys (usually names) with values. When you
- said "/three 3 def" that associated the literal name
- three with the integer 3 in the current diciotnary. The
- current dictionary is the one on top of the dictionary
- stack.
-
- The dictionary object on the dictionary stack is a
- composite object. Its value (all of the key-value pairs
- defined in it) is in VM. When you did the restore, VM was put
- back the way it was when you made the save object (via the
- save operator). That got rid of the definition of three,
- but left the current dictionary on top of the dictionary
- stack.
-
- Does that make sense? I'm not sure exactly what you didn't
- get, but I think that'll help.
-
- ab
-