comp.lang.ada
 help / color / mirror / Atom feed
From: "Rodrigo Garcia" <rodrigo.garcia@epfl.ch>
Subject: Re: Streams and Access types
Date: Fri, 31 Jan 2003 12:13:09 +0100
Date: 2003-01-31T12:13:09+01:00	[thread overview]
Message-ID: <3e3a5a47$1@epflnews.epfl.ch> (raw)
In-Reply-To: x7visw62wwu.fsf@smaug.pushface.org

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1322 bytes --]

"Simon Wright" <simon@pushface.org> wrote in message
news:x7visw62wwu.fsf@smaug.pushface.org...
> Stephen Leake <Stephen.A.Leake@nasa.gov> writes:
>
> > Rodrigo Garc�a <rodrigo.garcia@epfl.ch> 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





      parent reply	other threads:[~2003-01-31 11:13 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-01-29 14:09 Streams and Access types Rodrigo García
2003-01-29 19:51 ` Stephen Leake
2003-01-30 20:41   ` Simon Wright
2003-01-30 21:56     ` James S. Rogers
2003-01-31 11:13     ` Rodrigo Garcia [this message]
replies disabled

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