From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.5-pre1 (2020-06-20) on ip-172-31-74-118.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-1.9 required=3.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.5-pre1 Date: 17 Dec 92 19:31:04 GMT From: sampson@cod.nosc.mil (Charles H. Sampson) Subject: Functions That Only Raise an Exception Message-ID: <1992Dec17.193104.27782@nosc.mil> List-Id: 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