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: fac41,b2bad1e85ca20475 X-Google-Attributes: gidfac41,public X-Google-Thread: 103376,5b3c19b1631bb558 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2000-10-31 11:28:34 PST Path: supernews.google.com!sn-xit-02!sn-xit-03!supernews.com!europa.netcrusader.net!204.127.161.3!wn3feed!worldnet.att.net!wnmasters2!bgtnsc06-news.ops.worldnet.att.net.POSTED!not-for-mail Message-ID: <39FF1DBD.74184FDC@worldnet.att.net> From: James Rogers X-Mailer: Mozilla 4.75 [en] (Win98; U) X-Accept-Language: en MIME-Version: 1.0 Newsgroups: comp.lang.eiffel,comp.lang.ada Subject: Re: The best thing/greatest feature summary References: <39DCB9E3.EAE8F426@ftw.rsc.raytheon.com> <39F9FCCE.D6719C6F@ftw.rsc.raytheon.com> <1c9kvs4uvj4ofd46f7a8vq0pju596iu2gr@4ax.com> <39fed7b6@rsl2.rslnet.net> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Date: Tue, 31 Oct 2000 19:28:33 GMT NNTP-Posting-Host: 12.74.129.59 X-Complaints-To: abuse@worldnet.att.net X-Trace: bgtnsc06-news.ops.worldnet.att.net 973020513 12.74.129.59 (Tue, 31 Oct 2000 19:28:33 GMT) NNTP-Posting-Date: Tue, 31 Oct 2000 19:28:33 GMT Organization: AT&T Worldnet Xref: supernews.google.com comp.lang.eiffel:941 comp.lang.ada:1667 Date: 2000-10-31T19:28:33+00:00 List-Id: Tom Hargraves wrote: > > Let > X := Ada > Y := Java > > then the wish is > > to add java.lang.reflect 'style' routines to the ada language > > Here's a simple example where I'd find it useful: > > Quite often in user written Ada error handling packages, it is nice to be > able to increase the detail in the error message, and be able to print or > log the name of the routine or class in which it occured. A 'debug' mode so > to speak. > > In ada I've seen this done by declaring constant strings which match (at the > time of writing) the text to be displayed or logged. However there is > nothing to link the content of these strings to the items they refer, so > during the life of an application mismatches can occur. > > java.lang.reflect has getName, getDeclaringClass, to name but two. > The java.lang.reflect 'style' of routines rely on the fact that Java creates a "Class" object for each class defined in a program. This "Class" object contains the name of the class, the name of the Super for the class, and several other pieces of information. I, for one, do not want this extra overhead in realtime programs. Realtime systems are frequently constrained by memory as well as by timing. The extra overhead of such shadow data structures is easily overlooked by developers. In realtime systems the consequences of such errors can be disasterous. If an Ada developer wants such a capability, then all you need is a simple generic package with parameters for all the items you want to identify. Each package can instantiate the generic with appropriate parameter values. The generic package would declare the "getName", "getDeclaringClass", and other java-like subprograms as needed. Jim Rogers Colorado Springs, Colorado