Article View: comp.lang.postscript
Article #1962Re: PostScript coding style question
From: Liam R. E. Quin
Date: Tue, 25 Aug 1992 20:41
Date: Tue, 25 Aug 1992 20:41
35 lines
1301 bytes
1301 bytes
glenn@rightbrain.com (Glenn Reid) writes:
> In a related (and silly) thread, I'm curious as to who has written the
> most deeply-nested "ifelse" or other statment in PostScript in a legitimate
> piece of PostScript code (e.g. not as an entry in the Most Obfuscated
> PostScript Contest). LaserPrep doesn't count :-)
This is where the NeWS `case' operator makes a big difference...
/IsSmallishPrime {
{
3 5 7 11 13 17 19 {
true
}
1 2 {
random 0.5 gt {
true
} {
true % change this to false if you are undecided
}
}
/Default { false }
} case
} def
Lee
--
Liam Quin, lee@sq.com, SoftQuad, Toronto, 416 239-4801; the barefoot programmer
lq-text (Unix text retrieval package) mailing list: lq-text-request@sq.com
latest released version: 1.10; ftp: ftp.cs.toronto.edu in directory: pub
If Adultery is for Adults, is Juvenal for Juveniles?
Technical Details
Message-ID:
<1992Aug25.204100.7821@sq.sq.com>Path:
arc1-ca.pugleaf.net!sparky!uunet!uunet.ca!wildcan!sq!leeReferences:
<1992Aug21.160313@eklektix.com> <865@rtbrain.rightbrain.com>Show Full Headers
Complete Article Headers
Newsgroups: comp.lang.postscript Path: arc1-ca.pugleaf.net!sparky!uunet!uunet.ca!wildcan!sq!lee From: lee@sq.sq.com (Liam R. E. Quin) Subject: Re: PostScript coding style question Message-ID: <1992Aug25.204100.7821@sq.sq.com> Organization: SoftQuad Inc., Toronto, Canada References: <1992Aug21.160313@eklektix.com> <865@rtbrain.rightbrain.com> Date: Tue, 25 Aug 92 20:41:00 GMT Lines: 35