Runtime Safety of Programs

matthews@math.uga.edu matthews@math.uga.edu
Mon, 31 Jan 2000 17:26:34 -0500 (EST)


David writes:
> Thanks for your reply... Unfortunately in real life, I also face the
> situation of expected files that might be missing, or incorrect user input,
> or any of a number of other situations in which I would normall throw an
> exception. It seems to me that those sorts of exceptional conditions are
> beyond the ability of any compiler to anticipate.
> 
> ... in applying Clean to typical realworld applications such
> as data acquisition and instrument control.

From my perspective the need for exceptions is not so clear. You can always
program exceptions in Clean the way you do in C. For example a file open
routine return a value like

		Succeed F
	| Fail M

where F is a file object and M is a string error message. Often what
people use exceptions for is this kind of simple error checking.

graham