comp.lang.ada
 help / color / mirror / Atom feed
From: "Matthew Heaney" <matthew_heaney@acm.org>
Subject: Re: I want 'Class'Input back!
Date: 1999/10/12
Date: 1999-10-12T00:00:00+00:00	[thread overview]
Message-ID: <3803cc6c_1@news1.prserv.net> (raw)
In-Reply-To: 7u0as6$fmm$1@nnrp1.deja.com

In article <7u0as6$fmm$1@nnrp1.deja.com> , Ted Dennison 
<dennison@telepath.com>  wrote:

> I'm experimenting with making a private type limited.

Good choice.

> Unfortunately doing this toasts the default definitions for the stream
> attributes for that type. But I *liked* the default definitions for the stream
> attributes. In fact, I need 'Input, 'Output, 'Class'Input, and 'Class'Output.

I think you only need to replace the stream attribute operations of the
*specific* type T.

The stream attributes T'Class'Input and T'Class'Output describe the
attributes of the *class-wide* type, which the compiler supplies for
you.

The compiler implements T'Class'<whatever> by calling the ops you supply
for the specific type. (I think.)


> So just write my own clones of those attributes, then do a "for
> typename'{Attribute} use", right? Well, the problem is I can't figure
> out is how to (re)make 'Class'Input myself. Its definition from the LRM
> is:

You don't have to.  Just supply ops for T'Input and T'Output.


> First reads the external tag from Stream and determines the
> corresponding internal tag (by calling
> Tags.Internal_Tag(String'Input(Stream)) -- see 3.9) and then dispatches
> to the subprogram denoted by the Input attribute of the specific type
> identified by the internal tag; returns that result.

This is explaining how the compiler implements T'Class'Input -- by
calling your T'Input op.

> So how do I write Ada code to do this? I hope I'm missing something
> simple.

I think it is simple -- you don't have to do anything to get
T'Class'<op>, because the compiler does it for you.


Matt

--
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-10-12  0:00 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-10-12  0:00 I want 'Class'Input back! Ted Dennison
1999-10-12  0:00 ` Matthew Heaney [this message]
1999-10-13  0:00   ` Ted Dennison
1999-10-18  0:00     ` I want 'Class'Read back! (was: I want 'Class'Read back!) Ted Dennison
     [not found] ` <3814EF36.3D82D483@rational.com>
1999-10-26  0:00   ` I want 'Class'Input back! Ted Dennison
replies disabled

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