From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,6ae51c3be5bd0091 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-12-18 01:36:47 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!news.tele.dk!news.tele.dk!small.news.tele.dk!fu-berlin.de!uni-berlin.de!tar-alcarin.cbb-automation.DE!not-for-mail From: Dmitry A. Kazakov Newsgroups: comp.lang.ada Subject: Re: Streaming limited tagged types Date: Wed, 18 Dec 2002 10:36:46 +0100 Message-ID: References: NNTP-Posting-Host: tar-alcarin.cbb-automation.de (212.79.194.111) Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: fu-berlin.de 1040204206 1443576 212.79.194.111 (16 [77047]) X-Newsreader: Forte Agent 1.8/32.548 Xref: archiver1.google.com comp.lang.ada:32008 Date: 2002-12-18T10:36:46+01:00 List-Id: On 16 Dec 2002 18:32:22 -0500, Stephen Leake wrote: >Dmitry A. Kazakov 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: ":= ". And this arbitrary use of := triggers the problem. --- Regards, Dmitry Kazakov www.dmitry-kazakov.de