comp.lang.ada
 help / color / mirror / Atom feed
* Problem Eliminating constructors
@ 2003-01-17  0:19 Victor Porton
  2003-01-17 15:21 ` John English
                   ` (6 more replies)
  0 siblings, 7 replies; 15+ messages in thread
From: Victor Porton @ 2003-01-17  0:19 UTC (permalink / raw)


package A is

  type A_Type is tagged
    record
      X: Integer;
    end;
    
  function Create(X: Integer) return A_Type; -- guess what is the body
  
end A;

Then I have

type B_Type is new A.A_Type with
  record
    Y: Integer;
  end;

Compiler requires me to override Create as the return type changes.
But it is meaningless as now I need Create with two parameters
instead of one.

What to do?

Maybe there are a wau to make "function Create(X: Integer) return 
A_Type" not a primitive operation so that compiler will not more
request to override it?

Or maybe just move declaration of this func out of package A?



^ permalink raw reply	[flat|nested] 15+ messages in thread
* Re: Problem Eliminating constructors
@ 2003-01-17  6:54 Grein, Christoph
  0 siblings, 0 replies; 15+ messages in thread
From: Grein, Christoph @ 2003-01-17  6:54 UTC (permalink / raw)
  To: comp.lang.ada

> package A is
> 
>   type A_Type is tagged
>     record
>       X: Integer;
>     end;
>     
    package Avoid_Primitiveness is
>     function Create(X: Integer) return A_Type; -- guess what is the body
    end Avoid_Primitiveness;
>   
> end A;
> 
> Then I have
> 
> type B_Type is new A.A_Type with
>   record
>     Y: Integer;
>   end;
> 
> Compiler requires me to override Create as the return type changes.
> But it is meaningless as now I need Create with two parameters
> instead of one.
> 
> What to do?
> 
> Maybe there are a wau to make "function Create(X: Integer) return 
> A_Type" not a primitive operation so that compiler will not more
> request to override it?
> 
> Or maybe just move declaration of this func out of package A?



^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2003-01-23 17:08 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-01-17  0:19 Problem Eliminating constructors Victor Porton
2003-01-17 15:21 ` John English
2003-01-17 21:10 ` Victor Porton
2003-01-18 15:19 ` Simon Wright
2003-01-20 11:39 ` Rodrigo García
2003-01-20 21:07 ` Victor Porton
2003-01-21  9:44   ` Dmitry A. Kazakov
2003-01-21 19:01     ` Martin Krischik
2003-01-21 11:43   ` Rodrigo García
2003-01-21 15:03   ` Stephen Leake
2003-01-21 13:09 ` Victor Porton
2003-01-22 15:26   ` Rodrigo García
2003-01-21 18:38 ` Victor Porton
2003-01-23 17:08   ` Stephen Leake
  -- strict thread matches above, loose matches on Subject: below --
2003-01-17  6:54 Grein, Christoph

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