comp.lang.ada
 help / color / mirror / Atom feed
From: Matthew Heaney <matthew_heaney@acm.org>
Subject: Re: Help - Constructors - ASAP.
Date: 1998/08/01
Date: 1998-08-01T00:00:00+00:00	[thread overview]
Message-ID: <m3r9z1vej5.fsf@mheaney.ni.net> (raw)
In-Reply-To: dewar.901945508@merv

dewar@merv.cs.nyu.edu (Robert Dewar) writes:

> <<But, a naieve reader would look at that and think that they could
> get back an object of *any* type in the class (as I have just proven
> :-) ), when in actuality they always get back the same class of
> object.
> >>
> 
> That's a pretty fundamental misunderstanding of what classwide
> programming is all about. Yes, of course people can have all sorts of
> misconceptions, but this one is pretty basic, and not a misconception
> that could stay arround very long!

I'm with Robert on this one.  You have to recognize something as an
idiom.  When you see a function

   function New_T return T'Class;

you just have to "know" that this is a constructor for T, and for T
only.  Once you recognize the idiom, you know instantly that

   type NT is new T with private;
...
   O : NT := New_T;

is wrong, even though the compiler won't tell you it's wrong.




  reply	other threads:[~1998-08-01  0:00 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-07-23  0:00 Help - Constructors - ASAP Maxim Senin
1998-07-26  0:00 ` Matthew Heaney
1998-07-27  0:00   ` dennison
1998-07-30  0:00     ` Robert I. Eachus
1998-07-30  0:00       ` tedennison
1998-07-31  0:00         ` Matthew Heaney
1998-07-31  0:00         ` Mats Weber
1998-07-31  0:00           ` Robert I. Eachus
1998-08-01  0:00             ` Matthew Heaney
1998-07-31  0:00           ` dennison
1998-08-01  0:00             ` Matthew Heaney
1998-08-01  0:00             ` Robert Dewar
1998-08-01  0:00               ` Matthew Heaney [this message]
1998-08-03  0:00             ` Mats Weber
1998-08-01  0:00       ` Robert Dewar
1998-08-01  0:00         ` Matthew Heaney
1998-08-03  0:00           ` Mats Weber
1998-08-03  0:00             ` Matthew Heaney
1998-08-03  0:00               ` Mats Weber
1998-08-04  0:00                 ` Matthew Heaney
1998-08-04  0:00                   ` Mats Weber
1998-08-05  0:00                     ` Matthew Heaney
1998-08-10  0:00           ` Robert I. Eachus
1998-08-03  0:00         ` tedennison
  -- strict thread matches above, loose matches on Subject: below --
1998-07-15  0:00 Maxim Senin
1998-07-16  0:00 ` Stephen Leake
replies disabled

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