home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / lang / postscri / 6503 < prev    next >
Encoding:
Text File  |  1993-01-28  |  1.9 KB  |  48 lines

  1. Newsgroups: comp.lang.postscript
  2. Path: sparky!uunet!destroyer!gatech!purdue!mentor.cc.purdue.edu!news
  3. From: ab@nova.cc.purdue.edu (Allen B)
  4. Subject: Re: question about restore
  5. Message-ID: <C1Kv4y.E7p@mentor.cc.purdue.edu>
  6. Sender: news@mentor.cc.purdue.edu (USENET News)
  7. Organization: Purdue University
  8. References: <1993Jan27.214901.19529@software.org>
  9. Date: Thu, 28 Jan 1993 18:53:21 GMT
  10. Lines: 36
  11.  
  12. In article <1993Jan27.214901.19529@software.org> marshall@software.org (Eric  
  13. Marshall) writes:
  14. > I do not understand why three is not defined after the restore. 
  15. > The red book says that restore does not affect the contents of the
  16. > dictionary stack, but there is obviously something more to it than
  17. > that.  Could someone please explain this to me?
  18.  
  19. It doesn't affect the dictionary stack, it affects the
  20. value of the dictionary (which is in virtual memory
  21. (VM)).  The save and restore operators have to do with VM.
  22.  
  23. The dictionary stack gets changed when you do things like
  24. begin and end.  You seem to have some confusion regarding
  25. the terminology and probably about the workings of
  26. dictionaries in general.
  27.  
  28. Briefly (I'm sure you can read a Red Book to fill in the
  29. gaps), a dictionary is an associative array that
  30. associates keys (usually names) with values.  When you
  31. said "/three 3 def" that associated the literal name
  32. three with the integer 3 in the current diciotnary.  The
  33. current dictionary is the one on top of the dictionary
  34. stack.
  35.  
  36. The dictionary object on the dictionary stack is a
  37. composite object.  Its value (all of the key-value pairs
  38. defined in it) is in VM.  When you did the restore, VM was put
  39. back the way it was when you made the save object (via the
  40. save operator).  That got rid of the definition of three,
  41. but left the current dictionary on top of the dictionary
  42. stack.
  43.  
  44. Does that make sense?  I'm not sure exactly what you didn't
  45. get, but I think that'll help. 
  46.  
  47. ab
  48.