comp.lang.ada
 help / color / mirror / Atom feed
From: sampson@cod.nosc.mil  (Charles H. Sampson)
Subject: Functions That Only Raise an Exception
Date: 17 Dec 92 19:31:04 GMT	[thread overview]
Message-ID: <1992Dec17.193104.27782@nosc.mil> (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

                 reply	other threads:[~1992-12-17 19:31 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed
replies disabled

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