🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.postscript
Article #3858

Questions about error handling in "system" PS software

#3858
From: Rob Bradlee
Date: Fri, 25 Sep 1992 17:18
47 lines
1943 bytes
I've started maintaining a piece of "system" PostScript that we include 
with our RIPs.  This code has very careful error handling which has raised
serveral questions in my mind.

	1) Glenn Reid mentions someplace in "Thinking in PS" that 
		/routine errordict /typecheck get exec 
	   is bad form.  In his example on pg. 139 he uses the form
		errordict begin (concatenate) typecheck end

	Would Glenn or any one else care to elaborate on the relative 
	benefits of using begin&end vs get exec?


	2) I see in Glenn's above example and in some of our code that 
	   I'm checking that the input is validated at the beginning
	   and if there is an error then one of the errordict routines
	   is called which has the effect of jumping out of the routine.
	   Therefore Glenn doesn't bother to put the rest of the code
	   in a ifelse clause.  For example:

			dup type /arraytype ne {
				errordict begin (concatenate) typecheck end
				} if
			rest of code here

	versus:


			dup type /arraytype ne {
				errordict begin (concatenate) typecheck end
				} {
				rest of code here
				} ifelse

	I much prefer the former example because it's much simpler, but
	are there any unknown consequences?

	3) Finally, one technique of validating a routines input is to
		{ dup } stopped
	   Is this any better than 
		count 1 ge

-- 
Rob Bradlee  w:(508)-658-5600 X5153 
Agfa Corporation.                      ...!{decvax}!cg-atla!bradlee
200 Ballardvale St.                        bradlee@cg-atla.agfa.com
Wilmington, Mass. 01887 
Technical Details
Message-ID: <10123@cg-atla.UUCP>
Path: arc1-ca.pugleaf.net!sparky!uunet!ulowell!swlvx2!cg-atla!bradlee

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!ulowell!swlvx2!cg-atla!bradlee
From: bradlee@cg-atla.UUCP (Rob Bradlee)
Newsgroups: comp.lang.postscript
Subject: Questions about error handling in "system" PS software
Keywords: error
Message-ID: <10123@cg-atla.UUCP>
Date: 25 Sep 92 17:18:28 GMT
Distribution: comp
Organization: Agfa Compugraphic Division, Wilmington, Mass. USA
Lines: 47