csw@ulysses.homer.nj.att.com (Chris Warth) (08/11/87)
"/foo 10 string cvs ==" produces "(foo)" when sent to our QMS ps-800. It produces "(/foo)" when sent to psh under NeWS (release 1.0, I believe). Who is right? Is the leading slash truly part of a literal? Or (more likely) will differing groups justify their output with the catch-all "It's an implementation dependent operator?" Chris Warth ATT Bell Laboratories Murray Hill, NJ ulysses!csw
greid@adobe.UUCP (08/18/87)
From: adobe!greid@decwrl.dec.com To: mimsy!sun!ulysses.homer.nj.att.com!csw (Chris Warth) Cc: NeWS-makers@brillig.umd.edu Subject: Re: cvs operator in NeWS Date: Tue, 18 Aug 87 08:01:25 PDT >From: sun!ulysses.homer.nj.att.com!csw (Chris Warth) >Subject: cvs operator in NeWS > "/foo 10 string cvs ==" produces "(foo)" when sent to our QMS ps-800. > It produces "(/foo)" when sent to psh under NeWS (release 1.0, I believe). > > Who is right? Is the leading slash truly part of a literal? Or (more > likely) will differing groups justify their output with the catch-all > "It's an implementation dependent operator?" > > Chris Warth > ATT Bell Laboratories > Murray Hill, NJ > ulysses!csw The "slash" notation is meant for the PostScript SCANNER, not the interpreter. A PostScript object (including a "name object") can be either literal or executable. The PostScript scanner/tokenizer recognizes the leading slash and hands a literal name object to the interpreter instead of an executable name object: /Name % literal name object--goes onto operand stack Name % executable name object--it is directly looked % up in the dictionary stack if it is not found % in a procedure body ("deferred execution"). Therefore, "/foo 10 string cvs" produces a STRING EQUIVALENT to the name object "foo" (regardless of whether it is a literal or executable name). The "==" operator will produce a HUMAN-READABLE equivalent of the object on the top of the operand stack (Note that it is "==" that adds the parentheses--they are not really part of the string). The slash is NOT part of the name. Consider some of the following PostScript fragments: (PostScript) cvn (Palatino-Roman) findfont /LiteralName cvx 10 string cvs /LiteralName cvx cvlit 10 string cvs I hope this helps. Glenn Reid Adobe Systems PostScript Software Support