From: Stephen Leake <stephen.a.leake.1@gsfc.nasa.gov>
Subject: Re: Renaming an abstract function
Date: 17 Nov 2001 13:33:03 -0500
Date: 2001-11-17T18:35:27+00:00 [thread overview]
Message-ID: <uk7wps0ww.fsf@gsfc.nasa.gov> (raw)
In-Reply-To: b4682ab7.0111161908.1d330e1@posting.google.com
adam@irvine.com (Adam Beneschan) writes:
> Stephen Leake <stephen.a.leake.1@gsfc.nasa.gov> wrote in message news:<uvggau5ro.fsf@gsfc.nasa.gov>...
> > "Nick Roberts" <nickroberts@adaos.worldonline.co.uk> writes:
> >
> > > When given the program:
> > >
> > > package Test1 is
> > > type T is abstract tagged limited private;
> > > function P (X, Y: in T) return T is abstract;
> > > function "*" (A, B: in T) return T renames P; -- error line
> > > private
> > > type T is abstract tagged limited null record;
> > > end;
> > >
> > > GNAT 3.12p on Windows 95 returns the error message:
> > >
> > > function that returns abstract type must be abstract
> > >
> > > Is this a bug in: (a) GNAT; (b) the RM95; or (c) my brain?
> >
> > Same error in gnat 3.14 (you should at least upgrade to 3.13p).
> >
> > RM 8.5.4 (2) says:
> >
> > 2. subprogram_renaming_declaration ::=
> > subprogram_specification renames callable_entity_name;
> >
> > The term "callable_entity_name" is not mentioned elsewhere in the
> > reference manual, which I find odd.
>
> Note that "callable_entity" is in italics, while "name" is not.
Well, not in the info version :). Guess there's a use for html, after
all :).
> In RM notation, that means that the language expects the syntax of a
> "name" (defined in 4.1), while "callable_entity" is a description
> that tells you what the name has to represent. I guess if you're
> searching a text file version of the RM, there's probably no
> indication that part of it is in italics.
Yes; "info format" is ASCII with hyperlinks. Nice for reading from
Emacs. But it does lose the italics. Hmm, Emacs 21.1 can probably do a
better job of displaying the html version; I'll try that.
> "callable entity" is easily found in the index.
Ah. I didn't think of that.
> A "callable entity" is defined (in 6(2)) to be a subprogram or
> entry. Thus an abstract subprogram is a callable entity even though
> you can't really call it.
Ok.
> I don't see any prohibition on renaming an abstract subprogram.
> However, renaming subprograms don't quite take on all the
> characteristics of the subprograms they rename; see 8.5.4(12) for
> instance. I suspect that has something to do with why renaming an
> abstract subprogram could lead to an error, but I don't have time
> right this minute to look into it further.
>
> -- Adam
--
-- Stephe
next prev parent reply other threads:[~2001-11-17 18:33 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-11-15 23:52 Renaming an abstract function Nick Roberts
2001-11-16 14:52 ` Stephen Leake
2001-11-17 3:08 ` Adam Beneschan
2001-11-17 17:47 ` Egil Harald Hoevik
2001-11-17 18:33 ` Stephen Leake [this message]
2001-11-17 22:00 ` Mark Biggar
2001-11-17 23:17 ` Nick Roberts
2001-11-19 15:38 ` Stephen Leake
2001-11-22 3:14 ` Nick Roberts
2001-11-23 15:40 ` Stephen Leake
2001-11-24 3:55 ` Nick Roberts
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox