[REBOL] Re: Object "Serialization"
From: gjones05:mail:orion at: 22-Feb-2001 16:32
> > > In a separate thread, a question was asked about serialization of
> > > objects by Sharriff Aina. I had a similar question in mind and
was
> > > hoping for an answer. Since the thread had gotten a bit off
topic,
> I'm
> > > reposting essentially the same question in this separate thread.
> > >
> > > To date, when I want to save an object, I've been using 'save.
Then
> > > when I need the object back, I use 'read and then 'do the object.
> > >
> > > For example:
> > >
> > > data: make object! [
> > > name: "Joe"
> > > ]
> > >
> > > save %my-object.r data
> > >
> > > ;... later i need the object ...
> > > data: read %my-object.r
> > > data: do data
> > > print data/name
> >
> > use 'load instead of 'read? Then you don't need to 'do the 'data ...
> > -pekr-
>
> Thanks, that is a good point!
> Scott
Actually, when I tried it, simply using 'load did not re-initialize the
object (unless I am missing some additional subtle point). I played
with several additional variations, with the same conclusions. So I
guess the way I've been doing it will have to be good enough. It still
seems as though there should be a more seemless and coherent way to
serialize the object.
Thanks for your attention, pekr.
--Scott