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.1 required=5.0 tests=BAYES_00, PP_MIME_FAKE_ASCII_TEXT autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII X-Google-Thread: 103376,b777be000a53166 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-01-31 03:13:16 PST From: "Rodrigo Garcia" Newsgroups: comp.lang.ada References: <3E37E080.3080608@epfl.ch> Subject: Re: Streams and Access types Date: Fri, 31 Jan 2003 12:13:09 +0100 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2600.0000 X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 NNTP-Posting-Host: lglpc31.epfl.ch Message-ID: <3e3a5a47$1@epflnews.epfl.ch> X-Trace: epflnews.epfl.ch 1044011591 128.178.76.8 (31 Jan 2003 12:13:11 +0200) Organization: EPFL Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!newsmi-us.news.garr.it!NewsITBone-GARR!news.mailgate.org!news-zh.switch.ch!epflnews.epfl.ch!not-for-mail Xref: archiver1.google.com comp.lang.ada:33637 Date: 2003-01-31T12:13:09+01:00 List-Id: "Simon Wright" wrote in message news:x7visw62wwu.fsf@smaug.pushface.org... > Stephen Leake writes: > > > Rodrigo Garc�a writes: > > > > > One solution is to do custom serialization but, does anybody knows > > > of an Ada compiler that can automatically serialize the objects > > > pointed by access variables (recursively if needed, such in the case > > > of the linked list)? > > > > This is not possible in general. How would the compiler resolve a > > circular list? All doubly-linked lists have circles, so it is a real > > problem. > > Clearly this can be done! Java does it (unless I'm mistaken). You have > to keep track of what's been serialized already, I suppose. You are right. Java does it by assigning a "handle" (a number starting at 0x7E0000) that identifies each serialized object. If the object is referenced again, Java serializes just its handle. There is a problem with this though. If the object is modified and sent again through the same stream, it will be identified by its handle and this will not reflect the modifications. You have to restart the stream in order to serialize the object again. Anyway, I only wanted to know if there is already an Ada compiler that does something similar. Rodrigo