🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.postscript
Article #1000

Name Lookups (Re: Building A PostScript Toolset)

#1000
From: Joe Pallas
Date: Sun, 03 Sep 1989 00:34
22 lines
1546 bytes
Glenn Reid gives three ways to use local dictionaries in PostScript
procedures.  One of them uses //, which doesn't work for the
LaserWriter Classic and isn't documented in the Red Book.  One of them
is hairy, but clean.  One of them is perfectly readable and portable,
but less desirable because it pays for a name lookup.

Can someone tell me why name lookups are so expensive in PostScript
that everybody goes out of their way to avoid them?  Instead, we get
gross things like // and bind (the use of which is officially
discouraged in the Red Book, but everybody uses it anyway).  And much
of the power of PostScript gets lost (try wrapping code that redefines
showpage around Mac PostScript, for example).

It seems to me that people spend more time cursing and circumventing
PostScript's dynamic name lookup than anything else.  

As for making a new dictionary every time a procedure is invoked,
that's the only way to use local variables in a recursive PostScript
procedure.

Oh, for a lexically scoped PostScript.
joe
Technical Details
Message-ID: <11641@polya.Stanford.EDU>
Path: arc1-ca.pugleaf.net!utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!wuarchive!cs.utexas.edu!tut.cis.ohio-state.edu!ucbvax!agate!shelby!polya!Neon.Stanford.EDU!pallas
References: <1989Aug30.184607.21647@agate.uucp> <1139@adobe.UUCP>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!wuarchive!cs.utexas.edu!tut.cis.ohio-state.edu!ucbvax!agate!shelby!polya!Neon.Stanford.EDU!pallas
From: pallas@Neon.Stanford.EDU (Joe Pallas)
Newsgroups: comp.lang.postscript
Subject: Name Lookups (Re: Building A PostScript Toolset)
Message-ID: <11641@polya.Stanford.EDU>
Date: 3 Sep 89 00:34:04 GMT
References: <1989Aug30.184607.21647@agate.uucp> <1139@adobe.UUCP>
Sender: USENET News System <news@Polya.Stanford.EDU>
Lines: 22