comp.lang.ada
 help / color / mirror / Atom feed
* Classwide Parameter?
@ 2004-10-11 16:01 matthias_k
  2004-10-11 16:53 ` Matthew Heaney
  0 siblings, 1 reply; 13+ messages in thread
From: matthias_k @ 2004-10-11 16:01 UTC (permalink / raw)


Hiya,

I have experimented a little, and I can't really figure out what I need 
classwide parameters for. Consider this code:

package Shape_Pkg is
    type Shape is abstract tagged null record;
    procedure Draw (obj: Shape);
end;

package Circle_Pkg is
    type Circle is new Shape with null record;
    procedure Draw (obj: Circle);
end;

...

procedure Test is
    c: Circle;
begin
    Draw( c ); -- calls Circle_Pkg.Draw
end Test;

------------

Now, if I change Shape_Pkg.Draw's formal parameter to Shape'Class, 
what's the difference? In both cases it's legal to call Draw on a Circle.

- Matthias



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

end of thread, other threads:[~2004-10-12 15:13 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-10-11 16:01 Classwide Parameter? matthias_k
2004-10-11 16:53 ` Matthew Heaney
2004-10-11 17:08   ` matthias_k
2004-10-11 19:16     ` Simon Wright
2004-10-11 22:53     ` Brian May
2004-10-12  2:29     ` Matthew Heaney
2004-10-12  8:01       ` matthias_k
2004-10-12  8:53         ` Martin Krischik
2004-10-12 13:10         ` Matthew Heaney
2004-10-12  7:59     ` Dmitry A. Kazakov
     [not found]       ` <ckg3h6$qau$03$1@news.t-online.com>
2004-10-12  8:14         ` matthias_k
2004-10-12 15:13           ` Dmitry A. Kazakov
2004-10-12  8:10     ` Martin Krischik

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