🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.postscript
Article #960

Re: Case statements in Postscript

#960
From: Skip Montanaro
Date: Wed, 30 Aug 1989 13:29
24 lines
1522 bytes
Tom Kincaid asked about a case statement for PostScript. Sun wrote just such
a beast for NeWS. Perhaps somebody at Sun can make the decision to post it
(it is copyrighted). For anybody who might want to go out and write a case
function in PostScript, here's a syntax description of Sun's:


% A case/switch statement.  Takes a key for the case and an array.
% Generally the array is executable to avoid evaluating the array
% each time case is called:
%	obj {
%	    key1	{proc1}
%	    key2 key3	{proc2}
%	    key4	{proc3}
%	    /Default	{proc4}
%	} case


If somebody at Sun is listening, I think it would be a nice idea to post a
number of common functions defined in basics.ps, such as the rectangle and
list utilities, /case, /sprintf, and /append. I think this would help reduce
incompatible implementations of the same stuff in the future.

--
Skip Montanaro (montanaro@sprite.crd.ge.com)
Technical Details
Message-ID: <MONTNARO.89Aug30092917@sprite.crd.ge.com>
Path: arc1-ca.pugleaf.net!utzoo!attcan!utgpu!jarvis.csri.toronto.edu!rutgers!cs.utexas.edu!uunet!crdgw1!montnaro
References: <7573@cg-atla.UUCP>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!utgpu!jarvis.csri.toronto.edu!rutgers!cs.utexas.edu!uunet!crdgw1!montnaro
From: montnaro@sprite.crd.ge.com (Skip Montanaro)
Newsgroups: comp.lang.postscript
Subject: Re: Case statements in Postscript
Message-ID: <MONTNARO.89Aug30092917@sprite.crd.ge.com>
Date: 30 Aug 89 13:29:17 GMT
References: <7573@cg-atla.UUCP>
Sender: news@crdgw1.crd.ge.com
Reply-To: <montanaro@sprite.crd.ge.com> (Skip Montanaro)
Distribution: comp
Organization: GE Corporate Research & Development, Schenectady, NY
Lines: 24
In-reply-to: kincaid@cg-atla.UUCP's message of 29 Aug 89 17:14:24 GMT