Article View: comp.lang.postscript
Article #3638A question about //add
From: Bakul Shah
Date: Mon, 12 Nov 1990 19:52
Date: Mon, 12 Nov 1990 19:52
41 lines
1961 bytes
1961 bytes
All versions of the (Adobe) PostScript interpreter since version
25.0 provide an immediately evaluated name facility: When the
scanner encounters a `//name' token, it immediately looks up the
name in the current dictionary stack and substitutes the name's
value for the name[%]. The effect is as if the `load' operator
had been applied to the name (except that this happens in the
scanner).
Now the Question. If at the top level (i.e. not nested within
any braces) the input is
1 2 //add
should the operand stack contain
1 2 --add--
or
3
? You can test this by feeding
1 2 //add pstack clear
to your PostScript interprter.
My QMS PS 410 printer (running Adobe PostScript version 52.4) says
the stack has 1 2 --add--. Initially I thought that was the
correct behavior but L. Peter Deutsch <ghost@aladdin.com>, the
author of Ghostscript, argues the stack should contain 3 and I
agree with him now. Is the bug in the interpreter, the Supplement
document (:-) or did we miss something? Can we get an
*official* clarification?
Our reason for thinking the stack should contain 3 is this: Since
the scanner hands an *operator* to the interpreter, the
interpreter must execute the -add-- operator, following the rules
on page 42 of the Red Book (see the para. starting with `An
executable operator object...').
Yours in nitpicking
Bakul Shah <bvs@BitBlocks.COM>
or ..!{ames,att,decwrl,pyramid,sun,uunet}!amdcad!light!bvs
[%] See the Supplement document, available through Adobe's File
Server, for details as this feature is not described in the Red
Book.
Technical Details
Message-ID:
<1990Nov12.195235.13908@light.uucp>Path:
arc1-ca.pugleaf.net!utzoo!attcan!uunet!cs.utexas.edu!sun-barr!newstop!sun!amdcad!light!bvsShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!cs.utexas.edu!sun-barr!newstop!sun!amdcad!light!bvs From: bvs@light.uucp (Bakul Shah) Newsgroups: comp.lang.postscript Subject: A question about //add Message-ID: <1990Nov12.195235.13908@light.uucp> Date: 12 Nov 90 19:52:34 GMT Reply-To: bvs@BitBlocks.COM (Bakul Shah) Organization: Bit Blocks, Inc. Lines: 41