From: "Randy Brukardt" <randy@rrsoftware.com>
Subject: Re: Package's private parts and protected types
Date: Tue, 9 Feb 2010 20:39:41 -0600
Date: 2010-02-09T20:39:41-06:00 [thread overview]
Message-ID: <hkt69e$6fs$1@munin.nbi.dk> (raw)
In-Reply-To: 4e959c35-34d1-49fb-b1eb-5b298e42610f@z19g2000yqk.googlegroups.com
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1978 bytes --]
"Hibou57 (Yannick Duch�ne)" <yannick_duchene@yahoo.fr> wrote in message
news:4e959c35-34d1-49fb-b1eb-5b298e42610f@z19g2000yqk.googlegroups.com...
>On 9 f�v, 15:47, Robert A Duff <bobd...@shell01.TheWorld.com> wrote:
>> I agree that it's good to avoid heap management when possible.
>> But why can't you declare local variables of type My_Interface'Class,
>> initialized with build-in-place function calls?
>
>Synchronized-and-the-like interface types are limited, so the built-in-
>place is indeed really built-in-place (no kind of conversion allowed
>at any stage). The initializer function have to return a class wide
>and return it using an extended return statement which is required to
>return the same exact type/subtype as the one function returns.
>
>This way of doing thing is not compatible with the implementation-
>hiding requirement, as it would require the implementation type to be
>exposed in the public part, so that I could define a public function
>returning this exact type.
I don't buy this at all. The exact types to create can be selected by many
means (presumably by the parameters). You can use a dispatching constructor
function in the concrete types, using the factory pattern
(Generic_Dispatching_Constructor), and roughly organized as Bob noted.
Note that you have this problem with *any* constructor of any tagged type if
you have any interest at all in allowing future extensions.
It would be nice to have a container for Classwide limited types as the
problem comes up frequently. We made some initial efforts in that direction
but had problems with finalization and readability of the results. We then
turned our attention to those building-block problems and never did come
back to the limited containers themselves. I suspect that we could do a very
usable job with the new syntax magic for iterators, accessors, and the like.
(Presuming that we got those to work out, not there yet.)
Randy.
next prev parent reply other threads:[~2010-02-10 2:39 UTC|newest]
Thread overview: 51+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-02-08 4:30 Package's private parts and protected types Hibou57 (Yannick Duchêne)
2010-02-08 8:30 ` Martin
2010-02-08 9:11 ` Hibou57 (Yannick Duchêne)
2010-02-08 10:10 ` Alex R. Mosteo
2010-02-08 10:46 ` Hibou57 (Yannick Duchêne)
2010-02-09 14:55 ` Alex R. Mosteo
2010-02-08 10:20 ` Dmitry A. Kazakov
2010-02-08 10:54 ` Hibou57 (Yannick Duchêne)
2010-02-08 10:58 ` Hibou57 (Yannick Duchêne)
2010-02-08 11:01 ` Dmitry A. Kazakov
2010-02-08 13:19 ` Georg Bauhaus
2010-02-08 15:17 ` Robert A Duff
2010-02-08 16:15 ` (see below)
2010-02-08 20:44 ` Robert A Duff
2010-02-08 22:00 ` Hibou57 (Yannick Duchêne)
2010-02-09 5:48 ` AdaMagica
2010-02-09 14:56 ` Robert A Duff
2010-02-10 2:29 ` Randy Brukardt
2010-02-11 23:46 ` Robert A Duff
2010-02-12 1:29 ` Randy Brukardt
2010-02-11 23:53 ` Robert A Duff
2010-02-12 1:10 ` Randy Brukardt
2010-02-10 16:05 ` Adam Beneschan
2010-02-10 20:17 ` sjw
2010-02-12 0:05 ` Robert A Duff
2010-02-12 11:07 ` Stephen Leake
2010-02-12 15:01 ` Robert A Duff
2010-02-13 8:00 ` Stephen Leake
2010-02-09 9:04 ` stefan-lucks
2010-02-08 17:11 ` Jeffrey R. Carter
2010-02-08 14:56 ` Robert A Duff
2010-02-08 15:36 ` Dmitry A. Kazakov
2010-02-08 16:06 ` Robert A Duff
2010-02-08 17:46 ` Jean-Pierre Rosen
2010-02-08 20:39 ` Robert A Duff
2010-02-08 21:54 ` Hibou57 (Yannick Duchêne)
2010-02-08 21:50 ` Hibou57 (Yannick Duchêne)
2010-02-08 22:04 ` Hibou57 (Yannick Duchêne)
2010-02-09 10:58 ` Hibou57 (Yannick Duchêne)
2010-02-09 14:47 ` Robert A Duff
2010-02-09 19:34 ` Hibou57 (Yannick Duchêne)
2010-02-09 20:19 ` Hibou57 (Yannick Duchêne)
2010-02-09 23:29 ` Robert A Duff
2010-02-10 2:39 ` Randy Brukardt [this message]
2010-02-10 5:12 ` Hibou57 (Yannick Duchêne)
2010-02-10 7:17 ` Hibou57 (Yannick Duchêne)
2010-02-10 16:09 ` Robert A Duff
2010-02-10 22:21 ` Hibou57 (Yannick Duchêne)
2010-02-11 0:48 ` Robert A Duff
2010-02-09 0:48 ` Randy Brukardt
2010-02-09 12:43 ` Hibou57 (Yannick Duchêne)
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox