comp.lang.ada
 help / color / mirror / Atom feed
* Functions That Only Raise an Exception
@ 1992-12-17 19:31 Charles H. Sampson
  0 siblings, 0 replies; only message in thread
From: Charles H. Sampson @ 1992-12-17 19:31 UTC (permalink / raw)


In article <1992Dec16.200205.8912@linus.mitre.org> jclander@texas.mitre.org (Ju
lian C. Lander) writes (responding to a request for an example of a function th
at does nothing but raise an exception):

>I didn't write this one, but it is in some code I'm using.
>The situation is interface with C-language functions, which return
>error codes.  The chunk of code before me (I don't know a good noun
>for what it is--it builds about 3 different executables) has a function
>called Raise_Appropriate_Exception, which raises the exception 
>corresponding to the return code it has been passed.
>
>Since it never gets a 0 (its caller should avoid that), it doesn't return.
>
>I don't know that it's the best solution to the problem (I'm not wild
>about it, frankly), but that's what I have.

     I can think of a number of questions about this function.  The one
I'm most interested in is why is it a function rather than a procedure?
Particularly a function whose name is a verb phrase?

				Charlie

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~1992-12-17 19:31 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1992-12-17 19:31 Functions That Only Raise an Exception Charles H. Sampson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox