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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,8ed8f00df051b989 X-Google-Attributes: gid103376,public From: "James S. Rogers" Subject: Re: Ada exception limitations Date: 2000/02/26 Message-ID: #1/1 X-Deja-AN: 590115507 References: <89738j$f27$1@nnrp1.deja.com> X-MimeOLE: Produced By Microsoft MimeOLE V4.72.2106.4 X-Complaints-To: abuse@worldnet.att.net X-Trace: bgtnsc04-news.ops.worldnet.att.net 951531981 12.74.129.179 (Sat, 26 Feb 2000 02:26:21 GMT) Organization: AT&T Worldnet NNTP-Posting-Date: Sat, 26 Feb 2000 02:26:21 GMT Newsgroups: comp.lang.ada Date: 2000-02-26T00:00:00+00:00 List-Id: >#2: No ability to associate user data with exceptions. I know it's >possible to raise an exception with an associated string message, and I >could use this to pass the error number as a string, but this seems >kludgy. Actually, this is a lot less kludgy from an efficiency point of view. The package Ada.Exceptions allows you to do a number of very useful things with exceptions. The other possibility, of course, is to use a lot of different exceptions, which can get kludgy. Each subclass can raise exactly the same exception, while providing a unique message in the Raise_Exception procedure call. Parsing a string can be a lot simpler and less kludgy than attempting to "catch" a C++ exception when you do not know its type or class. In fact, the difficulties with using C++ exceptions generally lead to two different results. The first and most common is to refuse to use them at all. The second is to standardize on a single exception class ( commonly strings ) to communicate exception information. The first case is regretable, and not what I want to see for Ada. The second reduces C++ exceptions to Ada exceptions. I do not see any reason for Ada to change to C++ style exceptions. Look into the wonderful possibilities using Ada.Exceptions and being able to "log" exceptions using arrays or lists of Exception_Occurrence. This gives you most of the more useful aspects of being able to define your own exception class. Jim Rogers Colorado Springs, Colorado