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,d6413a22d4aaecda X-Google-Attributes: gid103376,public From: Stephen & Tammy House Subject: Re: Program identification Date: 1996/09/02 Message-ID: <322B6652.44CD@ro.com>#1/1 X-Deja-AN: 178075220 references: to: Chris Sparks content-type: text/plain; charset=us-ascii organization: RENAISSANCE INTERNET SERVICES mime-version: 1.0 newsgroups: comp.lang.ada x-mailer: Mozilla 3.0b6 (Win95; I) Date: 1996-09-02T00:00:00+00:00 List-Id: Chris Sparks wrote: > > Does anyone know of a way to determine the program name within a program > without explictly making a constant for it. If there isn't a way then > maybe a new attribute should be made for the next version of Ada, namely: > > P'Identity which returns a string, P is a program unit > > I am using this information as part of an exception reporter system. > > BTW these would be helpful too: > > P'Location which returns a string, P is a program unit and the string would > contain the current line number in the source code, or maybe even the previous > line number (for exception processing). > > Any thoughts? Exceptions tend to be tacked on to a design. But proper exception definition is just as important as subprogram and parameter definitions. Exceptions are, in fact, a set of boolean parameters passed out of a subprogram call. They are different in that if any of these parameters goes high none of the rest of the data coming out of the call may mean anything. Your exception definitions should tell your handlers what blew up and why. Ada95 has a few more tricks added for exceptions than Ada83. But, as always, there is no substitute for a good design.