comp.lang.ada
 help / color / mirror / Atom feed
From: petter_fryklund@hotmail.com
Subject: Dispatching problem.
Date: Tue, 15 Jan 2008 10:55:46 -0800 (PST)
Date: 2008-01-15T10:55:46-08:00	[thread overview]
Message-ID: <2d63ad45-4d52-4cb2-8dea-e1f92ecaacac@q77g2000hsh.googlegroups.com> (raw)

Hi all!

I get compilation error when I  try to dispatch a call using class
wide access variables stating that I cannot call abstract program.

Perhaps oversimplified example is:

package PBN is
   type Item_T is abstract tagged null record;
   type Item_Ptr is access all Item_T'Class;
   function  Create (From : in String) return access Item_T'Class is
abstract;
   function  Img (From : access Item_T'Class) return String is
abstract;
end PBN;

package PBN.Site is
   type Site_T is new Item_T with
      record
         Name :  ASU.Unbounded_String;
      end record;
   type Site_Ptr is access all Site_T;

   function  Create (From : in String) return Site_Ptr;
   function  Img (From : access Site_T) return String;
end PBN.Site;

with Ada.Text_IO;
with PBN;
with PBN.Site;
procedure Print is
    Site :  PBN.Item_Ptr;
begin
    Site := PBN.Site.Create ("[Site qwerty]");
    Ada.Text_IO.Put_Line (Site.Img);             <-----------------
cannot call abstract program
end Print;

Any suggestions (apart from taking extensive course in OOD ;-) ?

Regards,
Petter



             reply	other threads:[~2008-01-15 18:55 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-15 18:55 petter_fryklund [this message]
2008-01-15 19:49 ` Dispatching problem Dmitry A. Kazakov
2008-01-15 20:01   ` petter_fryklund
  -- strict thread matches above, loose matches on Subject: below --
2003-02-06 14:04 Petter Fryklund
2003-02-06 15:33 ` James S. Rogers
2003-02-07  7:35   ` Petter Fryklund
2003-02-07  9:01 ` Dmitry A. Kazakov
2003-02-07 14:55   ` Petter Fryklund
2003-02-10  9:12     ` Dmitry A. Kazakov
2003-02-11  8:31       ` Petter Fryklund
replies disabled

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