comp.lang.ada
 help / color / mirror / Atom feed
From: Robert A Duff <bobduff@shell01.TheWorld.com>
Subject: Re: GNAT: bug or feature?
Date: Mon, 15 Mar 2010 17:21:30 -0400
Date: 2010-03-15T17:21:30-04:00	[thread overview]
Message-ID: <wcc8w9tz3fp.fsf@shell01.TheWorld.com> (raw)
In-Reply-To: 4b9e927a$0$21789$426a74cc@news.free.fr

Damien Carbonne <damien.carbonne@free.fr> writes:

> Thanks (both of you) for explanations.
> Indeed, when no new component is added, it seems possible for the
> compiler to automatically generate the required function.

Exactly.  The compiler generates something like:

   overriding
   function Create return Derived is
   begin
      return (Base'(Create) with null record);
   end Create;

which just returns the same thing as the Base type's Create,
but with the Tag set properly for the Derived type.

By the way, you're slightly misusing the term "base" -- that's
not what it means in Ada.  You could call it Parent.  Or Root.

A "base subtype" is something else.

- Bob



      reply	other threads:[~2010-03-15 21:21 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-14 21:16 GNAT: bug or feature? Damien Carbonne
2010-03-15  0:49 ` Robert A Duff
2010-03-15 10:05   ` AdaMagica
2010-03-15 20:03     ` Damien Carbonne
2010-03-15 21:21       ` Robert A Duff [this message]
replies disabled

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