From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,bc745b8412f53f25,start X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2004-02-28 05:00:34 PST Path: archiver1.google.com!news2.google.com!fu-berlin.de!uni-berlin.de!martinkl.dialup.fu-berlin.DE!not-for-mail From: Martin Klaiber Newsgroups: comp.lang.ada Subject: Error-names. Date: Sat, 28 Feb 2004 13:58:02 +0100 Organization: Freie Universitaet Berlin Sender: Martin Klaiber Message-ID: NNTP-Posting-Host: martinkl.dialup.fu-berlin.de (130.133.237.205) X-Trace: news.uni-berlin.de 1077973232 54272298 F 130.133.237.205 (10182) X-Orig-Path: not-for-mail User-Agent: tin/1.5.12-20020427 ("Sugar") (UNIX) (Linux/2.4.24 (i586)) Xref: archiver1.google.com comp.lang.ada:5919 Date: 2004-02-28T13:58:02+01:00 List-Id: Hi, this is not really a programming-problem (I hope), more a question about english terms. I write a library with an interface to C. The Ada-exceptions shall be turned into return-values for the C-functions. Like this: with Interfaces.C; package Something is -- Types: type C_Integer is new Interfaces.C.int; -- Exceptions and errors: General_Error : C_Integer := -1; Routine_Not_Defined : exception; Routine_Not_Defined_Error : C_Integer := -2; and so on... package body Something is function Do_Something return C_Integer is begin ... return 0; exception when Routine_Not_Defined => return Routine_Not_Defined_Error; when others => return General_Error; end Do_Something; end Something; My problem now is that I also want to define return values for exceptions like Constraint_Error. But I can't define something like: Constraint_Error : C_Integer := -3; as Constraint_Error is the name for the exception. And I don't want to use long names like: 'Routine_Not_Defined_Error_Constant' or similar. I also don't want to rename the exceptions, as other Ada-Programs might rely on them. Is there an english word instead of 'error' I could use? Like 'fault' for instance or 'mistake'? Constraint_Fault, Constraint_Mistake. Hm, sounds strange to me. Would it be alright though? Thanks a lot, Martin