From: Nick Roberts <nickroberts@blueyonder.co.uk>
Subject: Re: Persistence of limited tagged types
Date: Thu, 10 Apr 2003 15:40:30 +0100
Date: 2003-04-10T15:40:30+01:00 [thread overview]
Message-ID: <oprne4dshsbqmqul@news.cis.dfn.de> (raw)
In-Reply-To: <1ec946d1.0304091509.150cc6d7@posting.google.com>
On 9 Apr 2003 16:09:09 -0700, Matthew Heaney <mheaney@on2.com> wrote:
> Is T'Output available if type T is limited?
According to the RM95 (13.13 (36)) (which I'm certain you must have already
consulted, Matt) the stream-oriented attributes (Read, Write, Input,
Output) are defined for all types, but defaults are not provided for
limited types.
> GNAT lets me declare an output operation:
>
> type T is limited null record;
>
> procedure Output (Stream : access Root_Stream_Type'Class;
> Item : in T);
>
> for T'Output use Output;
>
> but then it refuses to let me call it:
>
> O : T;
> begin
> T'Output (Stream, O);
> end;
>
> I get an error message that "limited type T has no stream attributes."
>
> However, if I define T'Write, then GNAT compiles
>
> T'Write (Stream, O);
>
> without complaint.
>
> What's up with that? Is the expectation that T'Output can't be used
> for a limited type? Why does GNAT allow me to define the T'Output
> stream attribute [but not call it]?
I don't immediately see how this (GNAT's) behaviour obeys the standard.
It could be argued that since T in this example is a definite type, it is
not actually necessary to define or call T'Output, since T'Write could be
defined and called instead with the same effect. But I don't see how this
could permit GNAT to produce the error it does.
Perhaps I should ask which version of GNAT this was, and do some tests
myself?
--
Nick Roberts
Jabber: debater@charente.de [ICQ: 159718630]
next prev parent reply other threads:[~2003-04-10 14:40 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-04-07 12:47 Persistence of limited tagged types Jano
2003-04-07 14:47 ` Nick Roberts
2003-04-09 10:05 ` Nick Roberts
2003-04-10 3:32 ` tmoran
2003-04-09 23:09 ` Matthew Heaney
2003-04-10 14:40 ` Nick Roberts [this message]
2003-04-10 23:37 ` Robert A Duff
2003-04-11 16:39 ` Nick Roberts
2003-04-10 18:49 ` Randy Brukardt
2003-04-10 1:12 ` Matthew Heaney
2003-04-07 18:11 ` Stephen Leake
2003-04-07 19:07 ` Hyman Rosen
2003-04-07 22:09 ` Jano
2003-04-08 13:58 ` Matthew Heaney
2003-04-10 11:41 ` Julio Cano
2003-04-10 19:14 ` Jano
2003-04-11 12:54 ` Julio Cano
2003-04-07 20:17 ` Robert Spooner
2003-04-07 21:14 ` Stephen Leake
2003-04-08 12:56 ` Robert Spooner
2003-04-08 13:41 ` Jano
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox