Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!tut.cis.ohio-state.edu!pt.cs.cmu.edu!RIGEL.FAC.CS.CMU.EDU!moore From: moore@RIGEL.FAC.CS.CMU.EDU (Dale Moore) Newsgroups: comp.lang.postscript Subject: Re: Procedures, dictionaries & the toolchest Message-ID: <7114@pt.cs.cmu.edu> Date: 28 Nov 89 13:56:45 GMT References: <2012@atanasoff.cs.iastate.edu> Distribution: na Organization: Carnegie-Mellon University, CS/RI Lines: 27 John Hascall recently posted the following tool /PROC { % % /NAME { #locals begin .... end } PROC - % dup % /NAME {#...} {#...} dup % /NAME {#...} {#...} {#...} 0 get % /NAME {#...} {#...} #locals 0 exch % /NAME {#...} {#...} 0 #locals dict % /NAME {#...} {#...} 0 put % /NAME {D...} bind % /NAME {D...} def % } bind def Although it is a good tool for most applications, the problem I see is that the resulting procedure is non-reentrant. The procedure can not be recursive. The local variables are not allocated on a stack. The space for the local variables is allocated statically at procedure definition time. This difference is alot like the difference between Fortran and other languages like Algol, Pascal or C. Dale Moore