comp.lang.ada
 help / color / mirror / Atom feed
From: "Matthew Heaney" <matthew_heaney@acm.org>
Subject: Re: meaning of "current instance"
Date: 1999/11/11
Date: 1999-11-11T00:00:00+00:00	[thread overview]
Message-ID: <382b4885_4@news1.prserv.net> (raw)
In-Reply-To: cgGW3.175$dp.21730@typhoon-sf.snfc21.pbi.net

In article <cgGW3.175$dp.21730@typhoon-sf.snfc21.pbi.net> , 
tmoran@bix.com  wrote:

> In
>> type T is
>>   tagged record
>>     I : Integer := Init (T'Access);
> what does Init(T'Access) mean?

The locution "T'Access" inside the declaration of type T means the
"current instance" of the type, similar to "self" in other languages.

This syntax seems to throw everyone off, I guess because you're using
the name of a type (instead of an object) as the target of 'Access.

No, it is not an error.  "<type name>'Access" means "current instance"
of the type.

What I'm trying to do here is let a descendent define what the default
value of a component is, for a component declared in the ancestor.

Function Init takes an access parameter designating T'Class.  It is
implemented by calling a primitive operation that dispatches according
to the tag of the "current instance," which can be any type in the
class.


--
If we let the Creationists have their way, we may as well go whole hog.
Let us reintroduce the flat-earth theory, the chemistry of the four
elements, and mediaeval astrology.  For these outworn doctrines have
just as much claim to rival current scientific views as Creationism does
to challenge evolutionary biology.

Abusing Science: The Case Against Creationism
Philip Kitcher




  reply	other threads:[~1999-11-11  0:00 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-11-11  0:00 meaning of "current instance" Matthew Heaney
1999-11-11  0:00 ` tmoran
1999-11-11  0:00   ` Matthew Heaney [this message]
1999-11-12  0:00     ` tmoran
1999-11-11  0:00       ` Matthew Heaney
1999-11-12  0:00         ` tmoran
1999-11-12  0:00           ` Matthew Heaney
1999-11-12  0:00             ` tmoran
1999-11-12  0:00               ` Matthew Heaney
1999-11-13  0:00             ` Robert A Duff
1999-11-13  0:00           ` Nick Roberts
1999-11-13  0:00             ` Robert A Duff
1999-11-14  0:00               ` tmoran
1999-11-13  0:00                 ` Matthew Heaney
1999-11-15  0:00                   ` John English
1999-11-15  0:00                     ` Matthew Heaney
1999-11-11  0:00 ` Robert A Duff
1999-11-11  0:00   ` Matthew Heaney
1999-11-11  0:00     ` Tucker Taft
1999-11-15  0:00   ` Tucker Taft
1999-11-15  0:00     ` tmoran
1999-11-15  0:00       ` Tucker Taft
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox