On Sat, 7 Jul 2001 03:27:36 +0900
Emil Ong <onge / mcs.anl.gov> wrote:

> Hi,
> 
> I was thinking that it might be useful to cache the marshalled version
of
> an object with the object itself.  If you were writing some code that
> had to marshal objects repeatedly and had a chance of remarshalling
the
> same thing twice, this could save some time.  I admit, this might just
be
> a symptom of bad coding, but I've run into it recently.  For example,
> if you had an array with two or more references to the same large
> object and you wanted to marshal the array, this could be useful. 
This
> feature could be togglable: Marshal.enable_caching and
> Marshal.disable_caching.
> 
> Does this seem useful to anyone?
> 

You can create a _dump method in your large objects to provide caching,
but unfortunatly there is no Object#_dump to initially obtain the
string. It means you can't call 'super' in your _dump method.

It would be nice if Marshal always called the _dump method and the
Object class would provide a default one, wouldn't it?


Mike.
midulo.