Article View: comp.lang.postscript
Article #5032Re: defeating save/restore (summary)
From: Frank Jensen
Date: Thu, 14 Mar 1991 20:13
Date: Thu, 14 Mar 1991 20:13
32 lines
1729 bytes
1729 bytes
In article <39120@netnews.upenn.edu> jeffe@eniac.seas.upenn.edu (George Jefferson ) writes:
...
Many people sugested leaving my value on the stack.
I suppose my question was not as well posed as it could have been,
but there is a _lot_ of code between the 'restore' and the place where
I am allowed to insert my code. I would have to be very careful with
the stack indeed :-)
I don't see the problem. Suppose you have a special dictionary you
use to store your values, call it `mydict'. Then you can use this
dictionary at will, provided you redefine `restore':
/-restore /restore load def % save old `restore' operator
/restore
{ mydict {} forall mydict length % load values onto the stack
dup 2 mul 2 add -1 roll % get restore object
-restore % do the restore
mydict begin {def} repeat end % save the values
} def
--
-george george@mech.seas.upenn.edu
--
Frank Jensen, fj@iesd.auc.dk
Department of Mathematics and Computer Science
Aalborg University
DENMARK
Technical Details
Message-ID:
<FJ.91Mar14201308@indigo.iesd.auc.dk>Path:
arc1-ca.pugleaf.net!utzoo!news-server.csri.toronto.edu!cs.utexas.edu!hellgate.utah.edu!caen!zaphod.mps.ohio-state.edu!rpi!uupsi!sunic!dkuug!iesd!iesd.auc.dk!fjReferences:
<38972@netnews.upenn.edu> <1909@chinacat.Unicom.COM> <1991Mar11.145130.12027@cl.cam.ac.uk> <39120@netnews.upenn.edu>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!news-server.csri.toronto.edu!cs.utexas.edu!hellgate.utah.edu!caen!zaphod.mps.ohio-state.edu!rpi!uupsi!sunic!dkuug!iesd!iesd.auc.dk!fj From: fj@iesd.auc.dk (Frank Jensen) Newsgroups: comp.lang.postscript Subject: Re: defeating save/restore (summary) Message-ID: <FJ.91Mar14201308@indigo.iesd.auc.dk> Date: 14 Mar 91 20:13:08 GMT References: <38972@netnews.upenn.edu> <1909@chinacat.Unicom.COM> <1991Mar11.145130.12027@cl.cam.ac.uk> <39120@netnews.upenn.edu> Sender: news@iesd.auc.dk Organization: Mathematics and Computer Science, University of Aalborg Lines: 32 In-reply-to: jeffe@eniac.seas.upenn.edu's message of 14 Mar 91 02:01:45 GMT