🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: comp.lang.postscript
1 messages
1 total messages Started by Rob Bradlee Fri, 25 Sep 1992 17:18
Questions about error handling in "system" PS software
#3858
Author: 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 
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads