🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.postscript
Article #3949

Questions on PS errorhandling

#3949
From: Rob Bradlee
Date: Mon, 05 Oct 1992 12:03
51 lines
1930 bytes
I've started maintaining a piece of "system" PostScript code 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 "get exec" vs "begin...end".


	2) I see in Glenn's above example and in some of the 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: <10129@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 on PS errorhandling
Keywords: error
Message-ID: <10129@cg-atla.UUCP>
Date: 5 Oct 92 12:03:08 GMT
Distribution: comp
Organization: Agfa Compugraphic Division, Wilmington, Mass. USA
Lines: 51