comp.lang.ada
 help / color / mirror / Atom feed
From: Dmitry A. Kazakov <mailbox@dmitry-kazakov.de>
Subject: Re: Streaming limited tagged types
Date: Wed, 18 Dec 2002 10:36:46 +0100
Date: 2002-12-18T10:36:46+01:00	[thread overview]
Message-ID: <n3f00vs83hb2qgj1ei8bb9k0b455ujnfpt@4ax.com> (raw)
In-Reply-To: uof7l4k1l.fsf@nasa.gov

On 16 Dec 2002 18:32:22 -0500, Stephen Leake
<Stephen.A.Leake@nasa.gov> wrote:

>Dmitry A. Kazakov <mailbox@dmitry-kazakov.de> writes:
>
>> 2. Should I have S'Class'Input it would not help much in the case when
>> the object should be allocated in the heap. "new" with a qualified
>> expression will not work for a limited type.
>> 
>> Is there a way to stream limited tagged types?
>
>Why is the type limited in the first place?

Consider some sort of objects accessed through smart pointers, handles
whatsoever. These objects will never be copied using :=. They will
highly likely be limited to have access discriminants for instance, or
to be tasks etc. Now you want to archive these objects in a data base.
A possible way is to abstract the data base interface as a stream
object (which is not stream at all (:-))) because stream attributes
are so excellent for tagged types. Here you are.

>Normally, that's because
>you _should not_ copy it. So streaming it doesn't make any sense.

Copy /= construct. The goal of S'Input is not to copy, but to
construct a new object. It is just an unfortunate side effect that it
appears as a function. Constructor is not a function, however a
function can be used to generate constructor: ":= <function call>".
And this arbitrary use of := triggers the problem.

---
Regards,
Dmitry Kazakov
www.dmitry-kazakov.de



  reply	other threads:[~2002-12-18  9:36 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-12-16  8:36 Streaming limited tagged types Dmitry A. Kazakov
2002-12-16 23:32 ` Stephen Leake
2002-12-18  9:36   ` Dmitry A. Kazakov [this message]
2002-12-17  0:53 ` Randy Brukardt
replies disabled

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