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=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!feeder.eternal-september.org!aioe.org!.POSTED!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: article on acces types and dynamic serialization in Ada (2003) Date: Thu, 22 Feb 2018 14:04:50 +0100 Organization: Aioe.org NNTP Server Message-ID: References: <503e3322-ee8e-4d6f-9aa5-e7b98f87e8f8@googlegroups.com> <5d8580c2-b43d-4b2c-8a46-3a6ed33967aa@googlegroups.com> NNTP-Posting-Host: MyFhHs417jM9AgzRpXn7yg.user.gioia.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@aioe.org User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 X-Notice: Filtered by postfilter v. 0.8.3 Content-Language: en-US Xref: reader02.eternal-september.org comp.lang.ada:50550 Date: 2018-02-22T14:04:50+01:00 List-Id: On 22/02/2018 13:15, Mehdi Saada wrote: >>> what means exactly Some_access_type'Write(Stream1, Some_Pointer) ? >> Bug, unless >> 2. Stream is used for communication inside the same program, e.g. the >> pointer is simply marshaled. > "Bug", then why is it allowed... It is an elementary operation. It could be abstract though. > Considering access types as elementary types also confuses me. First > thing I learnt about them is you can't hardly ever assume they are > simple addresses, Why would you assume that? It is an implementation detail that should not be your concern. Ada's approach in most cases is to specify the required semantics and let the compiler (or designer of the package) to choose an implementation. > or elementary. As for point 2, isn't it what I did in > my first example ? I reset the file with mode IN, in immediate enclosing > block, Marshaling is same as passing things by value. When you pass a pointer you are responsible to keep it valid all time it to live. If it lives in the file then the target object must outlive that file. > There might be numerous ways around this linked data issue but having > a sane default implementation, as we already have defaults everywhere > you can still override. None of them is sane, because the RM does not require sanity. Sanity here means that you can serialize and deserialize in a portable way. [I have some "sane" implementations in Simple Components for some elementary types.] > Generics subprograms could be provided in the standard libraries. > Not enough requests maybe ? Serialization en large requires introspection Ada presently lacks. [It is almost always so that features missing in Ada have deeply rooted reasons for being missed.] -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de