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-11-01 06:04:02 PST Path: supernews.google.com!sn-xit-02!sn-xit-03!supernews.com!xfer13.netnews.com!netnews.com!howland.erols.net!newsfeed.mathworks.com!cyclone.swbell.net!nnrp1.sbc.net.POSTED!not-for-mail From: "Pat Rogers" Newsgroups: comp.lang.eiffel,comp.lang.ada References: <39DCB9E3.EAE8F426@ftw.rsc.raytheon.com> <39F9FCCE.D6719C6F@ftw.rsc.raytheon.com> <1c9kvs4uvj4ofd46f7a8vq0pju596iu2gr@4ax.com> <39fed7b6@rsl2.rslnet.net> <39FF1DBD.74184FDC@worldnet.att.net> <39ff792d@rsl2.rslnet.net> <39FF8DE3.EC0055B5@worldnet.att.net> Subject: Re: The best thing/greatest feature summary X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.00.3018.1300 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.3018.1300 Message-ID: Date: Wed, 1 Nov 2000 08:03:58 -0600 NNTP-Posting-Host: 208.191.184.67 X-Complaints-To: abuse@swbell.net X-Trace: nnrp1.sbc.net 973087441 208.191.184.67 (Wed, 01 Nov 2000 08:04:01 CST) NNTP-Posting-Date: Wed, 01 Nov 2000 08:04:01 CST Organization: SBC Internet Services Xref: supernews.google.com comp.lang.eiffel:949 comp.lang.ada:1681 Date: 2000-11-01T08:03:58-06:00 List-Id: "Ken Garlington" wrote in message news:wiUL5.2554$pq3.156683@news.flash.net... > "James Rogers" wrote in message > news:39FF8DE3.EC0055B5@worldnet.att.net... > > : If you only want to emulate the Member interface in java.lang.reflect > : you can instantiate the following generic package in the bodies of your > : packages. > : > : -------------------------------------------------------------------- --- > : -- Generic package to define a "common" interface for providing > : -- debug information. > : -------------------------------------------------------------------- --- > : generic > : > : Package_Name : String; > > This, of course, is the critical difference between your solution and the > Java solution. "Package_Name" may, or may not, be the name of the Ada > package -- its correctness is only enforced by the programmer's diligence > (particularly in the face of changes). The Java method does not depend upon > keeping the same information copied in two places, as in > > package MyPackage is -- [1] > > package R is new Reflect("MyPackage"); -- [2] > > Given that a goal of Ada is to reduce errors due to copying, the argument > that the Ada approach is not as desirable as the Java approach seems like a > valid criticism to me. It gets worse, of course, if you want to implement > more than just the package name: a full implementation of the Java > functionality could presumably include the names of types, objects, record > components, subprograms, parameters /return types, and exception names. There are two facilities within reflection: introspection and intercession. The above is an example of introspection, the ability of a computational process to query a representation of itself. Intercession allows the process to alter itself. For example, in the above discussion, intercession would support the insertion of the debugging code itself. Sun's Java only supports run-time introspection, but not intercession. For a fully reflective implementation of Java see OpenJava (http://www.hlla.is.tsukuba.ac.jp/~mich/openjava/). There are others too. For my PhD thesis I've implemented compile-time reflection for full Ada, including both introspection and intercession. It is similar to both OpenC++, arguably the most widely used reflective language (http://www.hlla.is.tsukuba.ac.jp/~chiba/openc++.html), and OpenJava. At some point I'll make it available. Pat --- Patrick Rogers Consulting and Training in: http://www.classwide.com Deadline Schedulability Analysis progers@classwide.com Software Fault Tolerance (281)648-3165 Real-Time/OO Languages Adam ... does not deserve all the credit; much is due to Eve, the first woman, and Satan, the first consultant. Mark Twain