comp.lang.ada
 help / color / mirror / Atom feed
From: sbelmont700@gmail.com
Subject: Re: Overring function and its returned type
Date: Fri, 9 Nov 2012 13:56:10 -0800 (PST)
Date: 2012-11-09T13:56:10-08:00	[thread overview]
Message-ID: <a264c716-084e-4e03-8080-18d241a3cc1e@googlegroups.com> (raw)
In-Reply-To: <op.wniye3txule2fv@cardamome>

On Friday, November 9, 2012 4:10:09 PM UTC-5, Hibou57 (Yannick Duchêne) wrote:
>
> Reading the above, one may say “that's silly, if you know the returned  
> 
> type, just specify it in the declaration, and this would additionally  
> 
> avoid a cumbersome checked conversion at every call place”.
> 
>

That's silly, because in such a case your classwide types are just for show.  If you are already coupled directly to P3, and already know that A is a P3.T, then you don't need to override or extend or cast anything: you already have full visibility for direct calls on anything in P3, and will have to go back and change the unit either way if down the road you create a P4.  Just create a non-overriding, not-necessarily-overloading function in P3 that returns whatever type you want, with whatever pre/post conditions you like.


-sb




  reply	other threads:[~2012-11-09 21:56 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-09  7:13 Overring function and its returned type Yannick Duchêne (Hibou57)
2012-11-09  7:22 ` Yannick Duchêne (Hibou57)
2012-11-09  8:24 ` Dmitry A. Kazakov
2012-11-09  9:14   ` Yannick Duchêne (Hibou57)
2012-11-09 13:11     ` Dmitry A. Kazakov
2012-11-09 21:36       ` Yannick Duchêne (Hibou57)
2012-11-09 19:24   ` Adam Beneschan
2012-11-09 19:34 ` Adam Beneschan
2012-11-09 22:00   ` J-P. Rosen
2012-11-09 22:30     ` Yannick Duchêne (Hibou57)
2012-11-09 19:57 ` sbelmont700
2012-11-09 21:10   ` Yannick Duchêne (Hibou57)
2012-11-09 21:56     ` sbelmont700 [this message]
2012-11-10  0:28     ` Yannick Duchêne (Hibou57)
2012-11-10  2:35       ` Yannick Duchêne (Hibou57)
2012-11-15 15:13   ` Peter C. Chapin
2012-11-16 10:40     ` Maciej Sobczak
2012-11-16 12:39       ` Peter C. Chapin
2012-11-16 15:27         ` Maciej Sobczak
2012-11-16 17:29           ` Peter C. Chapin
2012-11-17  4:16           ` Yannick Duchêne (Hibou57)
2012-11-17 19:11             ` Robert A Duff
2012-11-18 14:53               ` AdaMagica
2012-11-19  8:41                 ` Yannick Duchêne (Hibou57)
2012-11-19 13:04                   ` AdaMagica
2012-11-19 15:19                     ` Dmitry A. Kazakov
2012-11-19 23:42                   ` Randy Brukardt
2012-11-10  7:55 ` Randy Brukardt
2012-11-11  1:02   ` Yannick Duchêne (Hibou57)
replies disabled

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