🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.postscript
Article #1389

Re: Procedures, dictionaries & the toolchest

#1389
From: Dale Moore
Date: Tue, 28 Nov 1989 13:56
27 lines
1359 bytes
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 <dictionary with room for #locals>
        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
Technical Details
Message-ID: <7114@pt.cs.cmu.edu>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!tut.cis.ohio-state.edu!pt.cs.cmu.edu!RIGEL.FAC.CS.CMU.EDU!moore
References: <2012@atanasoff.cs.iastate.edu>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!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