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,5b3c19b1631bb558 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2000-11-02 06:33:36 PST Path: supernews.google.com!sn-xit-02!sn-xit-03!supernews.com!xfer13.netnews.com!netnews.com!cpk-news-hub1.bbnplanet.com!cambridge1-snf1.gtei.net!news.gtei.net!inmet!not-for-mail From: Tucker Taft Newsgroups: comp.lang.ada Subject: Re: Reflection (was: Re: The best thing/greatest feature summary) Date: Thu, 02 Nov 2000 09:33:35 -0500 Organization: AverStar (formerly Intermetrics) Burlington, MA USA Message-ID: <3A017B3F.3F61DDAC@averstar.com> 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> <3A00375E.19433DC0@worldnet.att.net> <3A00E2D0.42440CB0@acm.org> NNTP-Posting-Host: nebula.burl.averstar.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: inmet2.burl.averstar.com 973175615 17016 141.199.8.77 (2 Nov 2000 14:33:35 GMT) X-Complaints-To: usenet@inmet2.burl.averstar.com NNTP-Posting-Date: 2 Nov 2000 14:33:35 GMT X-Mailer: Mozilla 4.75 [en] (X11; U; SunOS 5.7 sun4u) X-Accept-Language: en Xref: supernews.google.com comp.lang.ada:1720 Date: 2000-11-02T14:33:35+00:00 List-Id: Ray Blaak wrote: > > Jeff Carter writes: > > I've been toying with this: > [...] > > generic -- Reflection > > -- null; > > package Reflection is > > Unit_Name : constant String; > > -- The full name of the unit in which this package is instantiated > [...] > > end Reflection; > [...] > > This package indicates that this kind of information is available in > > Ada. We just need an easier way to access it. > > Very cool. I agree, this is a very clever use of Expanded_Name and T'Tag. GNAT has a few implementation-defined attributes that provide things like current line number and file name, I believe, and it would seem a natural extension to provide things like current scope expanded name, or even generic actual parameter name. There are lot's of interesting possibilities here which don't really require run-time reflection, but rather generic-instantiation-time reflection, which at least in a macro-expanding model for generics seems quite doable. > Now if only tagged types could be declared within routines, and then we would > be all set. Tagged types can be declared anywhere. Type extensions are restricted to being at the same accessibility level as their ancestor types, but this isn't a type extension. > Or does instantiating this package within a routine actually work? (I don't > have an Ada compiler near me at the moment.) This should work anywhere. > > -- > Cheers, The Rhythm is around me, > The Rhythm has control. > Ray Blaak The Rhythm is inside me, > blaak@infomatch.com The Rhythm has my soul. -- -Tucker Taft stt@averstar.com http://www.averstar.com/~stt/ Technical Director, Commercial Division, AverStar (formerly Intermetrics) (http://www.averstar.com/services/IT_consulting.html) Burlington, MA USA