Path: utzoo!utgpu!jarvis.csri.toronto.edu!clyde.concordia.ca!uunet!intercon!news From: amanda@mermaid.intercon.com (Amanda Walker) Newsgroups: comp.lang.postscript Subject: Re: Defining procedures with named parameters Message-ID: <1990Mar1.214045.12172@intercon.com> Date: 1 Mar 90 21:40:45 GMT References: <1990Feb28.192129.9580@intercon.com> <14040@cit-vax.Caltech.Edu> Sender: @intercon.com Reply-To: amanda@mermaid.intercon.com (Amanda Walker) Organization: InterCon Systems Corporation, Sterling, VA Lines: 25 In article <14040@cit-vax.Caltech.Edu>, hemphill@cit-vax.Caltech.Edu (Scott Hemphill) writes: > The natural thing to do would be to save the old variable contents on the > stack before assigning the new ones. I knew I was forgetting some simple approach. Grin. I've been using deep binding in Lisp & PostScript for so long that I forgot about trying shallow binding... It still has the potential side effect problem, but at least it should work and is quite simple. If you restrict such procedures to returning single objects on the stack (or, even better yet, leaving the number of returned values on the top of the stack for the postlog code to look at), you don't even have to mess with the "counttoprocmark" stuff, which should be a speed win. Also, this way, it wouldn't take any more stack space than leaving the parameters on the stack would. Off to write some code... -- Amanda Walker InterCon Systems Corporation "Many of the truths we cling to depend greatly upon our own point of view." --Obi-Wan Kenobi in "Return of the Jedi"