[comp.lang.postscript] Bug in operator restore in Apple LW?

johani@nada.kth.se (Johan Ihren) (10/12/89)

In the PostScript Reference Manual, the cause of the error invalidrestore
is said to be that the operand-, dict- or execstack contains composite
objects whose value were created later than the saveobject that is being
restored. Take a look at this example:

%!
10 dict begin
  /saveob save def
  userdict /keepdict currentdict put
end keepdict begin
  saveob restore
  (ok.\n) print

This program produces an invalidrestore, atleast on the LW+ I used.
If the line starting with end is removed, it works.
But that line only pops the dict off the dictstack and pushes it back again!
Is this a bug or am I thinking wrong?
Thankful for any explanations, either here or to me or to
f86.fredric-ihren@vera.nada.kth.se

Johan Ihren
Royal Institute of Technology, Stockholm, Sweden.