From: Tucker Taft <stt@averstar.com>
Subject: Re: Reflection (was: Re: The best thing/greatest feature summary)
Date: Thu, 02 Nov 2000 09:33:35 -0500
Date: 2000-11-02T14:33:35+00:00 [thread overview]
Message-ID: <3A017B3F.3F61DDAC@averstar.com> (raw)
In-Reply-To: m3wvem274n.fsf@ns51.infomatch.bc.ca
Ray Blaak wrote:
>
> Jeff Carter <jrcarter@acm.org> 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
next prev parent reply other threads:[~2000-11-02 14:33 UTC|newest]
Thread overview: 42+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <39DCB9E3.EAE8F426@ftw.rsc.raytheon.com>
2000-10-27 22:08 ` The best thing/greatest feature summary Wes Groleau
2000-10-28 1:01 ` Lothar Scholz
2000-11-24 2:15 ` Peter Horan
2000-11-24 0:00 ` Lothar Scholz
2000-11-24 0:00 ` Friedrich Dominicus
2000-10-28 1:03 ` Lothar Scholz
2000-10-31 14:44 ` Tom Hargraves
2000-10-31 18:07 ` tmoran
2000-10-31 19:58 ` Larry Kilgallen
2000-11-01 1:56 ` Tom Hargraves
2000-10-31 19:28 ` James Rogers
2000-11-01 2:13 ` Tom Hargraves
2000-11-01 3:27 ` James Rogers
2000-11-01 12:48 ` Ken Garlington
2000-11-01 14:03 ` Pat Rogers
2000-11-01 15:30 ` James Rogers
2000-11-01 22:12 ` Tom Hargraves
2000-11-01 22:44 ` Ted Dennison
2000-11-01 22:54 ` Pat Rogers
2000-11-01 23:47 ` James Rogers
2000-11-02 5:25 ` Pat Rogers
2000-11-02 5:28 ` Pat Rogers
2000-11-02 22:00 ` Wes Groleau
2000-11-02 3:45 ` Reflection (was: Re: The best thing/greatest feature summary) Jeff Carter
2000-11-02 6:57 ` Ray Blaak
2000-11-02 8:42 ` tmoran
2000-11-02 11:19 ` David C. Hoos, Sr.
2000-11-02 18:09 ` tmoran
2000-11-02 12:51 ` David C. Hoos, Sr.
2000-11-03 2:26 ` Jeff Carter
2000-11-02 14:33 ` Tucker Taft [this message]
2000-11-02 16:02 ` Ted Dennison
2000-11-04 0:00 ` Florian Weimer
2000-11-03 2:23 ` Jeff Carter
2000-11-03 5:05 ` Randy Brukardt
2000-11-03 5:28 ` Ken Garlington
2000-11-04 4:13 ` Jeff Carter
2000-11-10 0:00 ` The best thing/greatest feature summary jacob navia
2000-10-31 21:01 ` Wes Groleau
2000-10-30 20:19 ` Roger Browne
2000-10-31 16:24 ` Greg
2000-10-31 16:55 ` Roger Browne
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox