[mercury-users] Exceptions and unique modes

Richard A. O'Keefe ok at atlas.otago.ac.nz
Fri Feb 23 15:40:14 AEDT 2001


	An interesting point was raised by Paul Massey here at MC, and that is a
	predicate should return either a status indicator or throw an exception but
	never do both.  So you could argue that the IO predicates should report
	EOF as an exception as well or return everything in the status
	indicator.
	
PL/I reported end-of-file as an exception and it was a stinking horrible
* P * A * I * N *.

End of file is not exceptional.  What has it got to do with status
indicators?  Reading a character from a file may either return a character
or and end-of-file object (bit of Scheme there, sorry).  That's no different
from looking at a list that may either be a pair or be empty.  Reaching
the end of a file is no more exceptional than reaching the end of a list.

--------------------------------------------------------------------------
mercury-users mailing list
post:  mercury-users at cs.mu.oz.au
administrative address: owner-mercury-users at cs.mu.oz.au
unsubscribe: Address: mercury-users-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-users-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the users mailing list